I have temp.tar.gz in $1
How do I get just 'temp' in another variable ?
I am using bash.
Thanks in advance.
Using bash
and GNU parallel
:
$ myFilename=`find . -maxdepth 1 -name *.gz -print0 | parallel -0 echo {.} | parallel -0 echo {.}`
$ echo $myFilename
./temp
Not as clean as the other approaches, for sure, but it will work with filenames with spaces in them.