![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ftp username with back slash | sam99 | Shell Programming and Scripting | 1 | 04-29-2008 06:19 AM |
| awk slash | McLan | Shell Programming and Scripting | 6 | 04-09-2008 11:00 AM |
| grep for forward slash | wxornot | Shell Programming and Scripting | 3 | 02-29-2008 07:01 PM |
| Globbing slash Wildcarding Question | scotbuff | Shell Programming and Scripting | 4 | 02-01-2007 09:10 PM |
| touching a file which contains slash char | axes | High Level Programming | 1 | 09-25-2006 02:54 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help with SED and forward slash
Using the script: (Called replaceit)
#!/bin/ksh String=$1 Replace=$2 sed -e "s/${orig}/${new}/g" oldfile.txt > newfile.txt In oldfile.txt, I'm looking for: getenv("Work") And change it To: /u/web I execute the script: replaceit "getenv(\""Work\"")" /u/web I'm getting sed command garbled. I know it has something to do with the slashes in /u/web Can someone lead me in the right direction? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
what happens if you change your sed statement to
Code:
sed -e "s!${orig}!${new}!g" oldfile.txt > newfile.txt
|
|
#3
|
|||
|
|||
|
Works beautifully, thanks!
|
|
#4
|
|||
|
|||
|
nice. tks a lot!
|
|||
| Google The UNIX and Linux Forums |