![]() |
|
|
|
|
|||||||
| 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 |
| Appending date to filename | aemunathan | Shell Programming and Scripting | 5 | 05-12-2008 04:21 AM |
| appending a file using sed in ksh | smac | Shell Programming and Scripting | 3 | 01-02-2008 01:09 PM |
| Reading specific contents from a file and appending it to another file | dnicky | Shell Programming and Scripting | 5 | 10-04-2005 02:45 AM |
| appending a file | chumba | UNIX for Dummies Questions & Answers | 1 | 05-24-2001 08:09 AM |
| Appending out to a file | Astudent | UNIX for Dummies Questions & Answers | 1 | 10-19-2000 11:17 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Date Not appending in log file
Hi experts . . .
Sunsolaris 9 version I have the script as below: Am getting log file as : archive_today_.log Please suggest. ################################################## set 'date' dd=$3 mon=$2 export mon yyyy=$6 export yyyy cd /oracle/P47/saparch LOG_FILE=/oracle/P47/saparch/archive_today_$date.log echo "*******************************************************************">> $LOG_FILE date >> $LOG_FILE sqlplus "/as sysdba"<< EOF >> $LOG_FILE set serveroutput on ; set time on ; recover automatic standby database; CANCEL exit EOF echo "Finish applying archives in SAP DR site..." >> $LOG_FILE echo " ----------------------------------------------------------">> $LOG_FILE echo "End SAP DR script " >> $LOG_FILE echo "=========================================================" >> $LOG_FILE.................................................................................................... . |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Hi,
Am I completely misunderstanding the problem here maybe? But the variable 'date' is never set anywhere ?! Why not : datestamp=$(date +'%d%m%Y') LOG_FILE=/oracle/P47/saparch/archive_today_$datestamp.log ... |
|
#3
|
|||
|
|||
|
Hi domivv,
thanks for reply . . . I modified like this: #set 'date' datestamp=$(date +'%d%m%Y') dd=$3 mon=$2 export mon yyyy=$6 export yyyy cd /oracle/P47/saparch LOG_FILE=/oracle/P47/saparch/archive_today_datestamp.log I got following error: archives_apply.sh: syntax error at line 11: `datestamp=$' unexpected |
|
#4
|
|||
|
|||
|
Quote:
Thanks Nagarajan G |
|
#5
|
|||
|
|||
|
Hi Nagrajan,
now script is like: #set 'date' datestamp='date +'%d%m%Y'' dd=$3 mon=$2 export mon yyyy=$6 export yyyy cd /oracle/P47/saparch LOG_FILE=/oracle/P47/saparch/archive_today_datestamp.log and output log file is: archive_today_datestamp.log it is not picking date values. . . rgds |
|||
| Google The UNIX and Linux Forums |