removing backslash in a variable in primetime shell

Status
Not open for further replies.

snehal.saini

Newbie level 6
Joined
Oct 3, 2011
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,357
Hi..
I'm working in primetime shell.
I have a variable like:
set x top/module/d

I want to convert this to top_module_d.

tried using "sed" command. But it is giving error when i search for "/". It works well for other characters like "_", "*","!" etc, but not with "/".

This is what i tried:

pt_shell> set x top/module/d
pt_shell> set p [sh echo $x |sed 's/\//:/g']
Error: sed: -e expression #1, char 5: unknown option to `s'
Use error_info for more info. (CMD-013)


Can anyone please suggest me a way out?
 

use perl outside of pt_shell at the commnd prompt like below

perl -p -i -e "s/\//_/g" input_file.txt > output_file.txt
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…