LoginSignup
23
25

More than 5 years have passed since last update.

よく使うシェルスクリプト

Last updated at Posted at 2015-06-12
自分のディレクトリに移動
#!/bin/sh

cd `dirname $0`
list.txtを一行づつ読み込んでループ
filename="list.txt"
cat ${filename} | while read -r line
do
  echo $line
done
ワイルドカードで検索したファイルリストをループ

files="*.txt"
for filepath in ${files}
do
  echo $filepath
done

パス文字列からファイル名などを抜き出す

23
25
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
25