![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| gethostbyname_r returns NULL when hostname has dash | uunniixx | IP Networking | 12 | 06-04-2008 02:02 AM |
| dash after ampersant | csecnarf | UNIX for Dummies Questions & Answers | 2 | 03-12-2008 03:47 PM |
| wc of characters in a file ignoring white space | sachin.gangadha | UNIX for Dummies Questions & Answers | 1 | 12-15-2007 06:13 PM |
| double-dash options | dhinge | Shell Programming and Scripting | 1 | 01-10-2007 10:32 PM |
| How to remove a file with a leading dash '-' in it's name? | GSalisbury | UNIX for Advanced & Expert Users | 3 | 05-05-2003 12:28 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
ignoring a dash in file name
so i have a simple file called -x and i need it renamed to x now i dont understand why when using the most basic methods, only the code Code:
mv ./-x x changes the file name while using any other type of escape characters around the dash, such as single/double quotations or backslash, doesnt. anyone? im completely new to unix and this seems out of the ordinary. im sure there is a very obvious answer to this shouldnt things like mv /-/x x or mv "-"x x work? |
|
||||
|
Quoting is to prevent interpretation by the shell, whereas option processing is handled by the program itself. The shell strips and discards quotes, so mv doesn't even see a difference between "-"x and -x (and /-/x is, frankly, neither here nor there).
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|