Created
July 26, 2021 05:35
-
-
Save object1985/e390333cf0b3c15a6765faabd78152ee to your computer and use it in GitHub Desktop.
Linuxコマンドでテキストファイル内に記載したファイルを順次処理
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Windows の WSL-Ubuntu での利用を想定。 | |
# テキストファイル内に処理対象のファイルの絶対パスを記載し、1行1行処理していく。 | |
# 処理結果をcheck.txtへ追記。 | |
# 以下の例では6行目のみを抽出。 | |
for f in `cat /mnt/c/sample/target.txt`; do echo $f; echo $f >> check.txt; head -n6 $f | tail -n1 >> check.txt; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment