Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top