[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Simple question regarding touch and mv



Tom Horsley wrote:
> On Sat, 20 Dec 2008 10:59:09 -0800
> Daniel B. Thurman wrote:
>
>   
>> Is this some
>> quirkiness in the way command arguments are
>> being handled?
>>     
>
> No quirkiness. Options start with -, putting quotes around a
> string doesn't change the fact that it starts with a -, it
> just changes the work the shell does to parse the option before
> passing it to the command. I have no idea who is parsing what
> when you pass '\-foo' though :-).
>
> The reliable way to pass anything to most commands is to tell
> the command you are done with options and everything else is
> a positional argument by using the -- option terminator:
>
> touch -- -foo
>
> Naturally, it depends on the command if it interprets -- that
> way or not, but 90% of the standard utility commands like
> mv, cp, touch, etc do in fact look for --.
>
> Another technique some people use for things that are filenames
> is this:
>
> touch ./-foo
>
>   

Don't some programs interpret -- as stdin?




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]