So, I wanted to write a (bash) shell function that returned a value to the calling routine, rather than set a global variable. I found that the following would do what I wanted
#!/bin/bash
func() {
echo "This is the return value:"
return
}
x=$(func "param")
echo "The return value is : $x"
And this is what we see
lovebox:tmp gjl$...
Read more »
Posts Tagged ‘ bash ’
10GbE
asm
bash
benchmark
binary
bss
compiler
core
corruption
cp
disks
enomem
exec
filer
flexvol
fork
ifconfig
linux
ndmp
netapp
network
nm
ontap
oracle
Performance
perl md5 scripts
pmap
reliability
rpm
Scripts
segv
SIGCLD
size
solaris
sort
sql
storage
strace
swap
sysstat
tpch
tradvol
truss
unix
unix commands