日本でボチボチ ビジネス実践

ニュージーランドから帰国後、ITビジネスを継続。。

コンピュータ

[ リスト ]

# chmod 666 *
-bash: /bin/chmod: Argument list too long

というエラーが出た時のためのスクリプト。
ディレクトリ内のファイル数が多すぎると実行できないという状況ですな。

# cat chmod_many.sh
if [ $# -ne 3 ]; then
echo First argument : a command you want to conduct.
echo Second argument : a privilege which you want to change the files to.
echo Third argument : a directory where you want to change privileges of all files.
echo Example1: $0 chown you:you /home/you/something
echo Example2: $0 chmod 666 /home/you/something
exit
fi


cd $3
ls > /tmp/chmod_many.sh.tmp
while read line
do
echo $1 $2 $line
$1 $2 $line
done < /tmp/chmod_many.sh.tmp


.
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
皐月待つ花橘の香をかげば
皐月待つ花橘の香をかげば
男性 / 非公開
人気度
Yahoo!ブログヘルプ - ブログ人気度について

過去の記事一覧

検索 検索

よしもとブログランキング

もっと見る

[PR]お得情報

ふるさと納税サイト『さとふる』
11/30まで5周年記念キャンペーン中!
Amazonギフト券1000円分当たる!
数量限定!イオンおまとめ企画
「無料お試しクーポン」か
「値引きクーポン」が必ず当たる!

その他のキャンペーン


プライバシー -  利用規約 -  メディアステートメント -  ガイドライン -  順守事項 -  ご意見・ご要望 -  ヘルプ・お問い合わせ

Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved.

みんなの更新記事