![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Listing files with full path | r_sethu | UNIX for Dummies Questions & Answers | 5 | 06-15-2009 03:56 AM |
| List files with full path | mr_bold | Shell Programming and Scripting | 3 | 10-07-2008 01:19 PM |
| to find the file with full path | surjyap | Shell Programming and Scripting | 5 | 01-18-2008 03:26 PM |
| getting full path from relative path | polypus | Shell Programming and Scripting | 4 | 03-25-2007 01:08 PM |
| Full path of executing script in ksh? | BriceBu | Shell Programming and Scripting | 2 | 09-19-2005 10:29 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Replace a filename with full path using sed
hi,
i need to replace a line a file with a new raw device location.. original file.. /opt/sybase/ASE1502/ASE-15_0/bin/dataserver \ -d/data/TST_AKS1/sybdevices/master.dat \ -e/logs/sybase/TST_AKS1/SFO_TST_AKS1.log \ -c/apps/sybase/ASE1502/ASE-15_0/TST_AKS1.cfg \ -M/apps/sybase/ASE1502/ASE-15_0 \ i need to change -d value to /dev/vx/rdsk/sandg-100/raw200-01 so new file should look like /opt/sybase/ASE1502/ASE-15_0/bin/dataserver \ -d/dev/vx/rdsk/sandg-100/raw200-01 \ -e/logs/sybase/TST_AKS1/SFO_TST_AKS1.log \ -c/apps/sybase/ASE1502/ASE-15_0/TST_AKS1.cfg \ -M/apps/sybase/ASE1502/ASE-15_0 \ i tried using sed i set the new file name in a varaiable export mydev=/dev/vx/rdsk/sandg-100/raw200-01 sed s/^-d.*/$mydev/g it didn't work.. any idea how to make work, it would be nice if i can use a shell variable inside sed command to replace the value... i even tried awk, but didn't work either awk '{ if ($1 ~= "-d") print $0 else print $mydevice }' <filename thanks AK |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|