Data that looks like this stored in a
shell var:
ide data: /dev/hda MaxMultCout=16 time=35s
throughput: 6.97 MB\s
I filter the data so:
parser() {
echo $vallines | awk ' {
if ($0) {
gsub(/.*: \/.*:/, "", $0)
print
}
}'
return
}
I have to hardcode the var name because if
pass the parameter to the shell function
like this:
parser() {
_val=$1
echo $_val | awk code
}
Then , of course I only get the
ide data line as input, which really is bad.
As it is I will have to rewrite this code
for each different variable input....
Any ideas? I would like to be able to
parameterize the shell function if at all possible.
TIA
MD
shell var:
ide data: /dev/hda MaxMultCout=16 time=35s
throughput: 6.97 MB\s
I filter the data so:
parser() {
echo $vallines | awk ' {
if ($0) {
gsub(/.*: \/.*:/, "", $0)
}
}'
return
}
I have to hardcode the var name because if
pass the parameter to the shell function
like this:
parser() {
_val=$1
echo $_val | awk code
}
Then , of course I only get the
ide data line as input, which really is bad.
As it is I will have to rewrite this code
for each different variable input....
Any ideas? I would like to be able to
parameterize the shell function if at all possible.
TIA
MD