エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント1件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
How do I best pass arguments to a Perl one-liner?
I have a file, someFile, like this: $cat someFile hdisk1 active hdisk2 active I use this shell sc... I have a file, someFile, like this: $cat someFile hdisk1 active hdisk2 active I use this shell script to check: $cat a.sh #!/usr/bin/ksh for d in 1 2 do grep -q "hdisk$d" someFile && echo "$d : ok" done I am trying to convert it to Perl: $cat b.sh #!/usr/bin/ksh export d for d in 1 2 do cat someFile | perl -lane 'BEGIN{$d=$ENV{'d'};} print "$d: OK" if /hdisk$d\s+/' done I export the variable d in
2014/08/06 リンク