Re: Simple question regarding touch and mv

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

 



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
Sorry, I posted my comment before your post!

Thanks for the information, it helps!
Dan

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux