LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-29-2006, 03:12 AM   #1
user52
Member
 
Registered: Nov 2006
Posts: 41

Rep: Reputation: 15
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.
 
Old 11-29-2006, 03:17 AM   #2
apsivam
Member
 
Registered: Mar 2005
Location: Chennai, India
Distribution: Ubuntu, CentOS
Posts: 72

Rep: Reputation: 15
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.
 
Old 11-29-2006, 03:33 AM   #3
user52
Member
 
Registered: Nov 2006
Posts: 41

Original Poster
Rep: Reputation: 15
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...
 
Old 11-29-2006, 03:39 AM   #4
user52
Member
 
Registered: Nov 2006
Posts: 41

Original Poster
Rep: Reputation: 15
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=
 
Old 11-29-2006, 07:41 AM   #5
apsivam
Member
 
Registered: Mar 2005
Location: Chennai, India
Distribution: Ubuntu, CentOS
Posts: 72

Rep: Reputation: 15
use file=/db/bkp/exp_$(date +%Y-%m-%d)
 
Old 11-29-2006, 07:58 AM   #6
blueCow
Member
 
Registered: Feb 2004
Location: Florida
Distribution: FreeBSD, CentOS, Debian, Mint
Posts: 111

Rep: Reputation: 17
What are you trying to accomplish? Please try to better explain yourself.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
thunderbird puts time instead of date under 'date' header wabbalee Linux - Software 4 11-26-2006 05:58 AM
current date - yesterday's date newbie_adm Linux - Newbie 4 09-04-2006 04:56 PM
Start Date + Time Duration = End Date/Time calculator? ToBe Linux - General 3 09-26-2005 11:17 AM
about the date bigapple Programming 6 08-07-2005 06:33 AM
lastlog date does not match system date? jcmj Linux - Networking 6 10-22-2002 01:09 PM


All times are GMT -5. The time now is 12:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration