UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old September 24th, 2003, 03:24 PM
Donboy's Avatar
Donboy Donboy is offline
The Evil Monkey
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 220 Donboy User rank is Private First Class (20 - 50 Reputation Level)Donboy User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 38 m 10 sec
Reputation Power: 6
Question Escape characters in a move command?

I am trying to create a shell script for the ksh shell. The script is intended to scan a directory looking for improper characters in the filenames. If it finds any, it moves the file using mv from the old filename to the new filename. The trouble is, you cannot move the file because it has improper characters in the filename!

So the question is, how can I escape those illegal characters? The types of characters I'm dealing with are like the ampersand, quotes, or the plus/minus symbol, which I think is just a converted whitespace.

How can I escape these characters when doing a move command? I already tried putting a backslash before each one and it didn't work.

Any input is welcome. Thanks!

Reply With Quote
  #2  
Old September 24th, 2003, 03:58 PM
druuna druuna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 137 druuna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 37 sec
Reputation Power: 0
rm 'a a' <- single quotes
or
rm a\ a <- escape (\) the special character
or
rm "a a" < double quotes

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Escape characters in a move command?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway