Pipe variable to CUT
Jeff Boyce
jboyce at meridianenv.com
Wed Apr 13 21:56:12 UTC 2005
Greetings -
I am having a problem using CUT to obtain a subset of text within a variable
in a simple shell script. The purpose of the shell script is to obtain the
current name of the tape in my tape drive so that I can determine if it the
appropriate tape to recycle. The first line of the script reads the name
currently assigned to the tape. The output of VALUE2 below should produce
the text *Wednesdays*, instead it is producing nothing. If I manually
enter..... tpname=Wednesdays|cut -f2 --delimiter=..... I get the output....
Wednesdays. But when running the script below I get nothing.
$VALUE1|cut -f2 -d= produces the same result. What am I missing, possibly
some simple escape or quote?
Input Script
VALUE1=`arkc -drive -read -D name=BisonTape`
echo 'Value1 : '$VALUE1
VALUE2=$VALUE1|cut -f2 --delimiter=
echo 'Value2 : '$VALUE2
Display Output
Value1 : tpname=Wednesdays
Value2 :
Jeff Boyce
www.meridianenv.com
More information about the redhat-list
mailing list