タグ

ブックマーク / inuz.hatenablog.com (1)

  • ハイフンで始まるファイルを作ったり消したりする。 - inuzのブログ

    FAQとも言えるコネタ。意外に知らない人が多いらしいので、記載。 $ touch -test touch: invalid date format `est'touchコマンドで、"-test" を作ろうとしたら、怒られた。 $ echo > -test $標準出力をリダイレクトすると怒られずに終了。作れたっぽい。 $ ls -l -test ls: invalid option -- e Try `ls --help' for more information.ls -l しようとしたら、これまた怒られた。 $ ls -l | grep test -rw-rw-r-- 1 inu inu 1 Sep 5 15:34 -testしかしながら、確かにファイルはある。いらないから消してみよう。 $ rm -test rm: invalid option -- t Try `rm --help'

    ハイフンで始まるファイルを作ったり消したりする。 - inuzのブログ
    shag
    shag 2010/08/03
    posix getopt マンセーってことですか
  • 1