The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Use 'date' in a script TexasGuy Shell Programming and Scripting 3 07-15-2008 04:19 AM
Date calculation script vish_indian Shell Programming and Scripting 18 04-24-2008 07:31 PM
awk script for date conversion charandevu Shell Programming and Scripting 2 04-08-2008 05:07 AM
Conditional Date Script cpd259 Shell Programming and Scripting 2 06-21-2007 01:01 PM
Specify a previous date as start date in shell script ritzwan0 Shell Programming and Scripting 2 09-25-2006 05:58 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-15-2008
magikminox magikminox is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 8
get tommorows' date from script and use in other script

Hi

I have a script that returns tommorows date in mm/dd/yy format.I want the date returnred by that script to be used by another script that executes some sql statements.
What i dont know is how to get the result returned from the script and use it as input for the other script that executes sql and takes the date as an input parameter.
My date script is like this:

#!/usr/bin/ksh
date '+%y %m %d' |
{
read YEAR MONTH DAY
DAY=`expr "$DAY" + 1`
case "$DAY" in
0)
MONTH=`expr "$MONTH" + 1`
case "$MONTH" in
0)
MONTH=12
YEAR=`expr "$YEAR" + 1`
;;
esac
DAY=`cal $MONTH $YEAR | grep . | fmt +1 | tail +1`
esac
echo"$MONTH/$DAY/$YEAR"
}

Thanx in advance
  #2 (permalink)  
Old 07-15-2008
mirusnet's Avatar
mirusnet mirusnet is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 146
Just include this one to the second script:

Code:
. /path/script.sh
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:41 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0