The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
non-numeric argument TiredOrangeCat UNIX for Dummies Questions & Answers 3 02-12-2007 10:37 PM
passing argument into awk prkfriryce Shell Programming and Scripting 4 02-01-2007 12:44 PM
ls and take each file as argument melanie_pfefer Shell Programming and Scripting 3 01-24-2007 05:10 AM
Stripped argument mikie Shell Programming and Scripting 4 09-28-2006 06:38 AM
argument parsing... midhun_u Shell Programming and Scripting 1 07-25-2006 07:38 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-27-2005
Registered User
 

Join Date: Oct 2005
Location: Michigan
Posts: 7
Stumble this Post!
Question argument help

if i have 2 arguments $1 and $2 how can i append them so that $2 is added to $1? It is really confusing me because it seems so simple, yet i can't get the shell script to work properly. Thanks.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 11-27-2005
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,513
Stumble this Post!
Some_new_variable="$1$2"
Reply With Quote
  #3 (permalink)  
Old 11-27-2005
Registered User
 

Join Date: Oct 2005
Location: Michigan
Posts: 7
Stumble this Post!
thanks for the help, but if i wanted to rename it, what would i do?
For example:
arg1=$1
arg2=$2
so if it type the following from the command line:
$ hello again
the file would be called helloagain
it basically appends arg2 to arg1 renaming the file. Thanks.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:17 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0