rokkonet

PC・Androidソフトウェア・アプリの開発・使い方に関するメモ

2018-04-28から1日間の記事一覧

標準入力あるいはコマンドライン引数からテキストファイルを受け取るシェルスクリプト

2018 Jul. 07.2018 Apr. 28.〈tailコマンドに渡す例〉if [ -p /dev/stdin ]; then tail -else tail $1fi〈readコマンドに渡す例〉 function outputLine() { while read Line do echo $Line done < /dev/stdin }if [ -p /dev/stdin ]; then cat -else cat $1f…