LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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
 
Thread Tools
Old 05-20-2004, 09:38 AM   #1
pantera
Member
 
Registered: May 2004
Posts: 80
Thanked: 0
passing values in shell


[Log in to get rid of this advertisement]
how can we pass a value from one script file to another ??
pantera is offline     Reply With Quote
Old 05-20-2004, 10:01 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,498
Thanked: 44
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"
Hko is offline     Reply With Quote



Reply

Bookmarks


Thread Tools

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
Passing form values between multiple forms!! AskMe Programming 5 09-07-2005 08:44 PM
Sed Command & Passing Values joey52 Linux - Newbie 4 12-27-2004 08:46 PM
shell scripting -- passing commands mehesque Linux - General 4 06-25-2004 11:28 AM
How to change parameter values of a function in shell script? Bassam Programming 0 01-25-2004 10:52 AM
passing quotes in shell script Tenor Trombone Programming 1 04-18-2001 10:26 PM


All times are GMT -5. The time now is 08:12 PM.

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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration