filenames starting with a '-'

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: sinck@ugive.comsinckugive.com
日付:  
題目: filenames starting with a '-'

\_ wrote:
\_ >
\_ > \_ There's a couple different ways to do it:
\_ > \_
\_ > \_ 1) cp -- -001 /wherever
\_ > \_ or
\_ > \_ 2) cp ./-001 /whereever
\_ >
\_ > 3) cp ?001 /wherever
\_ > 4) cp *01 /wherever
\_ >
\_ > shell expansions/wildcards are your friends.
\_ >
\_ > \_ The same format should work with rm and mv too.
\_ >
\_ > YMMV on different unices passing a --
\_
\_ Shell expansions result in the error:

Doh. Yeah. My bad. YMMV when you've been hacking too long and think
it's a good time to answer mail.

On the bright side, at least there were no suggestions of trying to
use rm on the ever popular "-rf *" file.

David