LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   date (https://www.linuxquestions.org/questions/linux-newbie-8/date-505812/)

user52 11-29-2006 02:12 AM

date
 
i want sysdate so that is i am create one shell script like

oracle]$vi date.sh
#!/bin/bash
a = $date
echo = a

shift + zz

it is right or i want to use this script in another script

like
#!/bin/bash
./exp ....... file=file_name_date ( in date word i want to store sysdate ) how can i do that ... plz. help

thanx.

apsivam 11-29-2006 02:17 AM

you do not need work hard this much. Lets say you want to create a file with name my_file_currentdate then do the following in you script
Code:

echo "This is my test file" >> my_file_$(date +%Y-%m-%d)
this will create a file named my_file_2006-11-29 (as of writing this) with "This is my test file" as content.

user52 11-29-2006 02:33 AM

thank you sir your reply but i have one question here ....

#!/bin/bash
./exp ....... file=file_name_date ( in date word i want to store sysdate )

i want to run above script in script how can show date according ur solution

echo " content" >> myfile ....

with "This is my test file" as content.

sir plz explain more i cann't understand above line....

reply plz i am in very trouble...

user52 11-29-2006 02:39 AM

thank you sir your reply but i have one question here ....

#!/bin/bash
./exp ....... file=file_name_date ( in date word i want to store sysdate )

i want to run above script in script how can show date according ur solution

echo " content" >> myfile ....

with "This is my test file" as content.

sir plz explain more i cann't understand above line....

reply plz i am in very trouble...


or sir can i use like this in my script...

#!/bin/bash
./exp hr/hr tables=employees file=/db/bkp/exp_$date( +%Y-%m-%d) log=

apsivam 11-29-2006 06:41 AM

use file=/db/bkp/exp_$(date +%Y-%m-%d)

blueCow 11-29-2006 06:58 AM

What are you trying to accomplish? Please try to better explain yourself.


All times are GMT -5. The time now is 03:11 AM.