I have written sub routines in unix. How can we get the return value of UNix sub routines. The return function gives the exit status only.
here's the command
position=`expr substr $longline 1 5`
can i write a function as follows and assign the value
get_pos () {
string=$1
$pos1=$2
pos2=$3
expr substr $longline $pos1 pos2
}
This should be called as:
firstname=get_pos $line 0 7
lastname=get pos $line 8 10
is it possible to do this in UNIX?
ANy suggestions are greatly appreciated.
Thanks
Cheap Computer Part Supply Buying Tips
VOIP Phone Service Guide
here's the command
position=`expr substr $longline 1 5`
can i write a function as follows and assign the value
get_pos () {
string=$1
$pos1=$2
pos2=$3
expr substr $longline $pos1 pos2
}
This should be called as:
firstname=get_pos $line 0 7
lastname=get pos $line 8 10
is it possible to do this in UNIX?
ANy suggestions are greatly appreciated.
Thanks
Cheap Computer Part Supply Buying Tips
VOIP Phone Service Guide