>>   $ echo "/pub/videos/nptel/Computer Science and Engineering/Data Structures 
>> And
>> Algorithms" | awk '{print $(NF - 1), $NF}' FS='/' OFS='/'
>
> It works, but however I could not store the output in a variable
> because of long file name in the output.
>
> echo $PWD | awk '{print $(NF-1), $NF}' FS='/' OFS='/'

Ok now.

subject=$(echo $PWD | awk '{print $(NF - 1), $NF}' FS='/' OFS='/')

S. Baskar
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
ILUGC Mailing List Guidelines:
http://ilugc.in/mailinglist-guidelines

Reply via email to