UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 9th, 2005, 03:26 PM
c2kdb c2kdb is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 3 c2kdb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 20 sec
Reputation Power: 0
beginner help: ksh triggering another ksh

all I'm trying to do is trigger one ksh within another ksh if c:/data/file.txt is not an empty file.


what I have in my script1 right now is:

if [ -s c:/data/file.txt ]; then
script2.ksh argument
fi


What is the correct way to call a script within a script? do I need to source the script first?

Reply With Quote
  #2  
Old August 9th, 2005, 04:58 PM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,308 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 5 h 20 m 49 sec
Reputation Power: 48
That's an odd filesystem name - c:

Code:
if [ -s c:/data/file.txt ]; then
  /path/to/script2.ksh argument
fi

Reply With Quote
  #3  
Old August 9th, 2005, 11:04 PM
c2kdb c2kdb is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 3 c2kdb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 20 sec
Reputation Power: 0
so I don't need to source the script2.ksh in the begining?

Reply With Quote
  #4  
Old August 10th, 2005, 09:54 AM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,308 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 5 h 20 m 49 sec
Reputation Power: 48
The only reason to source scripts is in the event it is going to make changes to environment variables or to some other envionment component. Changes you want to keep in the "main", calling process.

For example, when you login /etc/profile is sourced, so are .profile scripts. These define variables like PATH.

Reply With Quote
  #5  
Old August 12th, 2005, 04:20 PM
c2kdb c2kdb is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 3 c2kdb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 20 sec
Reputation Power: 0
Quote:
Originally Posted by jim mcnamara
The only reason to source scripts is in the event it is going to make changes to environment variables or to some other envionment component. Changes you want to keep in the "main", calling process.

For example, when you login /etc/profile is sourced, so are .profile scripts. These define variables like PATH.


thanks for your help

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > beginner help: ksh triggering another ksh


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT