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.
very neat! I tested it & looks the if statement evaluates if the returning code is 0 or not, isn't it??
However, I failed to make it to check if it is non-zero- tried a few syntax with no luck... such as: if [ ! domything ], if [ domything -ne 0 ].... can you make it?
all the variable arguments except $0, useful as $0 is normally the script name, I'm suggesting that the first CODE block be put in a file called "not".
wow... thank you "Porter"- or whoever you really are;-)
I've been doing a program with this new language in last couple of weeks. Now I'm really interested in learning more! I want to be as good as you one day... oh well, just wishful thinking;-)