![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
| Display Modes | Rate This Thread |
|
|