我有一个名为"LL1.txt“到"LL1180.txt”的文件列表,但我只对1到50之间的文件感兴趣,以便将它们粘贴到一个文件中。我试着用:
seq 1 50
for n in $(seq $1 $2); do
f="LL$n.txt"
if [ -e $f ]; then
paste "$f" > LL$1_$2.txt
fi
done
但这不起作用。
Data.txt包括大写和小写的单词.
我需要lower case them all except for the upper-cased characters that appear in braces,它紧跟在一个单词后面,可以以小写或大写结尾,但在第一个大括号之前没有空格。例如:
CAT{TT} Dog{DD} Horse{AA}
Snail{LL} RAT{TT}
ANT{AA}
这些应转化为:
cat{TT} dog{DD} horse{AA}
snail{LL} rat{TT}
ant{AA}
作为第一步,我将列表中的所有内容降为小写,并将它们放在lcChar中(代码如下)。然后,
我想打印瓶子歌(见)。
我的循环代码如下所示:
number <- c("Ten", "Nine", "Eight", "Seven", "Six", "Five", "Four", "Three", "Two")
and_if <- ("And if one green bottle should accidentally fall,")
bottles <- function() {
for (num in