Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ファイルの2行目を表示してから、大文字に変換しようとしています。
試しhead 2 file | tr [a-z] [A-Z]ました。
head 2 file | tr [a-z] [A-Z]
sed -n '2{p;q;}' file.txt | tr '[:lower:]' '[:upper:]'
また
awk 'NR==2{print toupper($0);exit}' file.txt
head -n2 file.txt | tail -n1 | tr '[:lower:]' '[:upper:]'
フォーム[:lower:] [:upper:]は推奨される方法です(POSIXクラス)
[:lower:] [:upper:]
POSIX