こんにちは〜インフラエンジニアのtamolabです! 今日はシャルスクリプトについて書こうと思います!私はよく業務でデータ処理やログ解析でシェルスクリプトを利用します!そのデータ処理の際によく利用する処理を書きたいと思います。Excelだと簡単に処理できる内容ではありますが、Excelで処理するには時間がかかりすぎますし、大きいファイルだとExcelで開くことができません。(行数や列数に制限があります)私は過去に10億行のファイルを処理したときは、迷わずシャルスクリプトを利用してサーバ上で処理を行いました。 1. やりたいこと フォルダ内のデータ(名前)を取得します。本記事ではフォルダ内ファイルの拡張子を.txtから.logに変更するループ文のシェルスクリプトを紹介します。 <実行前> 1.txt 2.txt 3.txt 4.txt 5.txt <実行後> 1.log 2.log 3.lo