我想读取长度为2的数组中文件的最后两行。 考虑文件a.txt bar
second line
hello world
foo bar fubar
我试图 lines=($(tail -n 2 a.txt))
但这会导致长度5的数组,每个包含一个字。我读了Creating an array from a text file in Bash的帖子,但没能从那里读到最后两行。请注意,效率(
我想在一个中添加多个尾巴脚本。 第一招: tail -f /var/script/log/script-log.txt | if grep -q "Text1"; then echo "0:$?:AAC32 ONLINE"
fi
我要添加5条线路用不同势的话,这可能吗? else if if if等 谢谢!
鉴于年底追加: mangle :: String -> String
,我想要做的事,如: mangle xs = head xs -- works if you change typesig to [a] -> a
但: mangle xs = tail xs ++ head xs -- won't work at all!
会喜欢在列表末尾添加列表的第一个字符,切割第一个字符。