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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to pass values between awk and shell scripts rajnikanth.1912 Shell Programming and Scripting 9 03-20-2009 02:25 PM
getting date from shell and pass it to java vanathi Shell Programming and Scripting 0 03-17-2008 04:49 AM
Shell scripting book adds excellent reference to your library - Linux PR (press relea iBot UNIX and Linux RSS News 0 07-12-2007 05:40 PM
Pass by reference in shell functions sonaluphale UNIX for Advanced & Expert Users 5 04-25-2007 01:11 PM
what is the max length of args i can pass in shell? senthilk615 Shell Programming and Scripting 6 06-13-2006 05:29 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-19-2003
csejl csejl is offline
Registered User
  
 

Join Date: Apr 2002
Posts: 29
pass by reference in shell

Hi,

I would like to write a function which takes one integer argument and adds 10 to it. But, I'd like to return the result in the data that was passed in. Is this possible?

function1()
{
1=$(($1+10))
}

my_number=1
function "$my_number"
echo $my_number

I'd like the echo statement to print 11 in this case. Is that the right syntax? I don't have a shell to test with right now... I appreciate your help. Thanks.
 

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




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


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0