Computing.Net > Forums > Unix > Character substitution

Character substitution

Reply to Message Icon

Original Message
Name: marion
Date: September 29, 2005 at 04:13:01 Pacific
Subject: Character substitution
OS: AIX 5.2
CPU/Ram: don't know
Comment:

Hi all.

I have to put the full path of a file into its name.
The problem is that unix won't accept the character "/" in the filename, so I have to substitute it with something else.
How can I do it via scripting?

I would be very grateful for any help!!

Thanks a lot,

Marion


Report Offensive Message For Removal

Response Number 1
Name: nails
Date: September 29, 2005 at 07:27:36 Pacific
Subject: Character substitution
Reply: (edit)

I don't understand your comment "that unix won't accept the character '/'". Typically, you escape the / meaning \/ to take away the special meaning.


Report Offensive Follow Up For Removal

Response Number 2
Name: marion
Date: September 30, 2005 at 01:44:40 Pacific
Subject: Character substitution
Reply: (edit)

I've already tried. It doesn't work.

For example:
$ touch \/me
touch: 0652-046 Cannot create /me.

Any other ideas?
Thanks very much!!

Marion


Report Offensive Follow Up For Removal

Response Number 3
Name: Jim Boothe
Date: September 30, 2005 at 06:19:06 Pacific
Subject: Character substitution
Reply: (edit)

touch /me is trying to create a file in the root directory. Maybe you do not have write permissions in the root directory?

The forward slash does not need to be escaped when dealing with path and file names.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Character substitution

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software