|
how to get return code in one line
I know how to get the returning code of a function but wonder if I can combine the follwoing two lines into one:
e.g.:
#!/bin/shell
...
#line 1
MyFunction arg1 arg 2
#line 2
rec=$? #this will be evaluated later
....
like in c/c++, we'd write one line:
rec=MyFunction(arg1, arg 2)
Because I have many of those funciton calls in one script where all return codes need to be collected & evaluated later. It'd look nicer with one less line here.
Thanks in advance.
Last edited by bluemoon1; 09-13-2007 at 02:45 PM..
|