I am passing a file name as a parameter to shell script
the parameter is getfile.txt.gpg
how do i process this parameter to get name like getfile.txt only and eleminate the .gpg text??
Thanks in advance
I am passing a file name as a parameter to shell script
the parameter is getfile.txt.gpg
how do i process this parameter to get name like getfile.txt only and eleminate the .gpg text??
Thanks in advance
Try:
#!/bin/ksh
file="$1"
workfile=${file%*.gpg}
echo "$workfile"
works fine
Thank you
I tried the following and works fine too
x=`echo $1|wc -c`
y=`expr $x - 5`
z=`echo $1|cut -c1-$y`
echo $z
Thank you
can you explain your code please??