Thursday, 8 August 2013

shell script to process a folder path

shell script to process a folder path

I am unable to process the following shell script
#!/bin/sh
P= '/mnt/temp/'
echo $P
Q= `echo $P` | sed -e "s/^.*\(.\)$/\1/"
echo 'Q is' $Q
echo ${P%?}
I expect the output as
/mnt/temp/
Q is /
/mnt/tmp

No comments:

Post a Comment