![]() |
|
|
|
|
|||||||
| 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 |
| Search, replace string in file1 with string from (lookup table) file2? | gstuart | Shell Programming and Scripting | 2 | 04-11-2008 11:32 AM |
| replace string in XML with sed | chiru_h | Shell Programming and Scripting | 6 | 04-09-2008 04:49 PM |
| replace string | sam99 | Shell Programming and Scripting | 4 | 03-03-2008 10:39 PM |
| replace a string | melanie_pfefer | Shell Programming and Scripting | 11 | 01-17-2008 07:57 AM |
| Replace string B depending on occurence of string A | hemangjani | Shell Programming and Scripting | 1 | 12-05-2006 02:10 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have to replace date in Control file every day i run the script
control file looks like this $cat pharma.ctl LOAD DATA INFILE '/usr/bin/sqlscripts/SQL.PharmID.20071206.txt' INTO TABLE uname.TEMP_TABLE FIELDS TERMINATED BY '|' TRAILING NULLCOLS (col_names) i tried $sed -e s/SQL.PharmID.[0-9]*.txt/SQL.PharmID.`date +%Y%m%d`.txt pharma.ctl>pharma.ctl Command Garbled can someone give me the right command |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
DD=SQL.PharmID.`date +%Y%m%d`.txt
echo $DD sed -e 's/SQL.PharmID.[0-9]*.txt/'$DD'/g' CONTROLFILE.ctl > CONTROLFILE.ctl.new |
|
#3
|
|||
|
|||
|
sed
Hi,
Code:
sed "s/SQL\.PharmID\.[0-9]*/SQL\.PharmID\.`date +%Y%m%d`/" filename |
|||
| Google The UNIX and Linux Forums |