![]() |
|
|
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 |
| xlC compilation error when dealing with operator overloading | luop0812 | AIX | 1 | 04-09-2008 05:09 PM |
| perl: When dealing with files that do not exist | joeyg | Shell Programming and Scripting | 2 | 02-20-2008 05:09 PM |
| Help in dealing with arra | jojan | Shell Programming and Scripting | 5 | 08-28-2007 03:14 PM |
| Problem starting a script from a 'main'-script | Rakker | UNIX for Dummies Questions & Answers | 3 | 06-28-2005 09:12 AM |
| how to change sh to tsch UNIX | simt | UNIX for Dummies Questions & Answers | 2 | 12-19-2003 05:03 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
tsch script problem (dealing with sed)
This is my first post so I hope I didn't cross any violations I have this script Code:
#!/bin/tcsh set pattern1=$1 shift set pattern2=$1 shift foreach file ($*) set data=`echo $file | sed s/$pattern1\$/$pattern2/g` $data > $file end My parameters are 1. the string to be replaced 2. the string with which to replace it 3. the name of the file in which to make the substitution I want to produce a new script that will apply a substitution to any number of files given on the command line like /tmp/subst cat dog File1.txt File2.txt File3.txt but I know I either missing something or I need to modify it but don't know what cause the script will not work for me at all. Thanks for any assistance. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|