Unix/Linux Go Back    

Answers to Frequently Asked Questions Answers to Beginners BSD, Linux, and UNIX shell scripting Frequently Asked Questions — This forum contains answers to frequently asked questions about how to use awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages. (Only Moderators and Administrators can add a thread to this forum. If you would like to make an addition to this forum, post your suggestion in the FAQ Submission Queue sub-forum.)

Passing variables/arguments/parameters to commands

Answers to Frequently Asked Questions

Thread Tools Search this Thread Display Modes
Old Unix and Linux 06-13-2004   -   Original Discussion by Perderabo
Perderabo's Unix or Linux Image
Perderabo Perderabo is offline Forum Advisor  
Unix Daemon (Administrator Emeritus)
Join Date: Aug 2001
Last Activity: 26 February 2016, 12:31 PM EST
Location: Ashburn, Virginia
Posts: 9,930
Thanks: 64
Thanked 471 Times in 271 Posts
Passing variables/arguments/parameters to commands

A good place to start is simple variable passing....
Passing variables from one script to another

The next level is passing a variable into a more complex command such as using a variable in a sed command. There are some simple quoting techniques that are very general. These are mentioned in...
How can I use a variable in sed?

Also awk has a couple of specific ways to handle this...
Passing values out awk.
PASS parameter to AWK
Passing argument to awk script

Doing this with aliases depends on your shell.....
Passing arguments to an alias
alias creation

Last edited by Perderabo; 06-28-2004 at 03:43 PM..
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Reading a string and passing passing arguments to a while loop goddevil Shell Programming and Scripting 19 01-15-2012 09:48 AM
Passing arguments to alias with multiple commands derndingle UNIX for Dummies Questions & Answers 5 05-20-2011 12:05 PM
Optional Parameters/arguments while executing a script. indrajit_u Shell Programming and Scripting 3 09-03-2010 03:58 PM
tar cmd how many arguments into parameters of filenames presul Shell Programming and Scripting 1 06-15-2010 06:02 AM
passing arguments zmfcat1 Shell Programming and Scripting 4 05-19-2009 04:34 PM

All times are GMT -4. The time now is 06:53 AM.