LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 05-20-2004, 08:38 AM   #1
pantera
Member
 
Registered: May 2004
Posts: 80

Rep: Reputation: 15
passing values in shell


how can we pass a value from one script file to another ??
 
Old 05-20-2004, 09:01 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,524

Rep: Reputation: 93
Like this:
Code:
#/bin/sh
# File: firstscript.sh

/path/to/secondscript.sh arg1 arg2 arg3
Code:
#/bin/sh
# File: secondscript.sh

# $0 contains the name of the script itself
# $1...$9 contain the first...nineth argument of the script
echo "Scriptname = $0"
echo "Argument #1 = $1"
echo "Argument #2 = $2"
echo "Argument #3 = $3"
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing form values between multiple forms!! AskMe Programming 5 09-07-2005 07:44 PM
Sed Command & Passing Values joey52 Linux - Newbie 4 12-27-2004 07:46 PM
shell scripting -- passing commands mehesque Linux - General 4 06-25-2004 10:28 AM
How to change parameter values of a function in shell script? Bassam Programming 0 01-25-2004 09:52 AM
passing quotes in shell script Tenor Trombone Programming 1 04-18-2001 09:26 PM


All times are GMT -5. The time now is 09:44 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration