I have ...
x=`tar -tvf file.tar | awk 'print $8}'`
which returns a full dir string with file name ...
x="dir/dir/filename dir/dir/filename2 dir/dir/dir/dir/filename3 ... etc."
I want to remove the filename portion of each element in the variable $x (without going through a some sort of loop) as an additional pipe ...
e.g. -
x=`tar -tvf file.tar | awk 'print $8}' | awk ???`
with desired result:
x= "dir/dir/ dir/dir/ dir/dir/dir/dir/"
I tried using functions: index, match, etc. but I can't seem to pull-out the file portion.
I'm open to unix ksh or sed commands as well ... basically I don't want to go through a loop.
any ideas ??? ... thanks!
x=`tar -tvf file.tar | awk 'print $8}'`
which returns a full dir string with file name ...
x="dir/dir/filename dir/dir/filename2 dir/dir/dir/dir/filename3 ... etc."
I want to remove the filename portion of each element in the variable $x (without going through a some sort of loop) as an additional pipe ...
e.g. -
x=`tar -tvf file.tar | awk 'print $8}' | awk ???`
with desired result:
x= "dir/dir/ dir/dir/ dir/dir/dir/dir/"
I tried using functions: index, match, etc. but I can't seem to pull-out the file portion.
I'm open to unix ksh or sed commands as well ... basically I don't want to go through a loop.
any ideas ??? ... thanks!