07-07-2008
global date for many scripts in shell
Hi,
I am using shell (#!/bin/bash), i am trying to set my date in a script date.sh, i want this dates to be used by another scripts.
I have tried to make:
#!/bin/bash
begin_date =`date +%Y_%m_%d_%H_%M_%S`,
i also tried:
#!/bin/bash
begin_date =20080709 12:14:11, then i write in other script the date as ($begin_date), but it always gives me begin_date : command not found!
I would like to write the date as numbers like date = 20080721 12:14:11 and then the other script should read it.
I think it should be simple, please can you help me how i can assign this date and time and how i should call it from my other scripts?
Thank you in advance.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can I determine when the particular file was created, in korn-shell. Can please someone help me. If possible please mail the solution to me.
my mail id: bharat.surana@gmail.com (1 Reply)
Discussion started by: BharatSurana
1 Replies
2. Shell Programming and Scripting
Hiee .... i want an immediate solution for this....
Let replace.cfg file contains a list of files to be replaced the old dates with new dates......
The script must take 3 parameters....
1) old date
2) new date
3) .config file
Can u get me the solution......
I tried with sed but i... (2 Replies)
Discussion started by: prasanna1983
2 Replies
3. Solaris
Hi Guys,
My requirement is I have file called /opt/orahome/.profile in non global zone.
PATH=/usr/bin:/usr/ucb:/etc:/usr/sbin:/usr/local/bin:/usr/openwin/bin:.
export PATH
PS1="\${ORACLE_SID}:`hostname`:\$PWD$ "
export PS1
EDITOR=vi
export EDITOR
ENV=/opt/orahome/.kshrc
export ENV... (1 Reply)
Discussion started by: vijaysachin
1 Replies
4. UNIX for Dummies Questions & Answers
Hello,
I am trying to show today's date and time in a better format than ‘date' (Using positional parameters). I found a command mktime and am wondering if this is the best command to use or will this also show me the time elapse since 1/30/70? Any help would be greatly appreciated, Thanks... (3 Replies)
Discussion started by: citizencro
3 Replies
5. UNIX for Dummies Questions & Answers
I am looking to do something where if I created a file named backup,or whatever it would print a name like “backup_Apr_11_2011”. Thanks citizencro (1 Reply)
Discussion started by: citizencro
1 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I need to create a shell script that appends a filename to create a name with the date and time appended that is guaranteed to not exist. That is, the script insures you will not overwrite a file with the same name. I am lost with this one. I know I need to use date but after that I am... (3 Replies)
Discussion started by: citizencro
3 Replies
7. Shell Programming and Scripting
Hi,
Have assigned values in Array and iterating in while loop and would require values outside of the loop. But its returning NULL.
could you please help us how to define Global array declaration in Unix shell scripting?
i am using Kron shell.
Thanks in advance. (2 Replies)
Discussion started by: periyasamycse
2 Replies
8. Shell Programming and Scripting
Hi,
I have a file which has a date extension to it.
Like <filename>_01012014.
I need to rename the file as 12152013 , that is i need to be able to subtract 15 days from the date of the file name.
Please advise how this can be handled using shell scripting.
Regards,
VN (8 Replies)
Discussion started by: narayanv
8 Replies
9. Solaris
hi all,
Just a simple question but i cant get the answers in the book -
In my globalzone , assuming i have 4 cpus (psrinfo -pv = 0-3), if i set dedicated-cpu (ncpus=2) for my local zone
Is my globalzone left with 2 cpus or still 4 cpus ? Does localzone "resource reservation.e.g. cpu in... (6 Replies)
Discussion started by: javanoob
6 Replies
10. Solaris
Hi,
If I change date and time in global zone, then it will affect in non global zones.
During this process what files will get affect in non global zones and which mechanism it's using to change.
gloabl zone:Solaris 11.3 X86
TIA (1 Reply)
Discussion started by: Sumanthsv
1 Replies
LEARN ABOUT DEBIAN
iso8601
PACEMAKER(8) System Administration Utilities PACEMAKER(8)
NAME
Pacemaker - Part of the Pacemaker cluster resource manager
SYNOPSIS
iso8601 command [output modifier]
DESCRIPTION
iso8601 - Display and parse ISO8601 dates and times
OPTIONS
-?, --help
This text
-$, --version
Version information
-V, --verbose
Increase debug output
Commands:
-n, --now
Display the current date/time
-d, --date=value
Parse an ISO8601 date/time. Eg. '2005-01-20 00:30:00 +01:00' or '2005-040'
-p, --period=value
Parse an ISO8601 date/time with interval/period (wth start time). Eg. '2005-040/2005-043'
-D, --duration=value
Parse an ISO8601 date/time with duration (wth start time). Eg. '2005-040/P1M'
Output Modifiers:
-L, --local
Show result as a 'local' date/time
-O, --ordinal
Show result as an 'ordinal' date/time
-W, --week
Show result as an 'calendar week' date/time
For more information on the ISO8601 standard, see: http://en.wikipedia.org/wiki/ISO_8601
AUTHOR
Written by Andrew Beekhof
REPORTING BUGS
Report bugs to pacemaker@oss.clusterlabs.org
Pacemaker 1.1.7 April 2012 PACEMAKER(8)