Page 1 of 1

Need to use $1 to find folder name

PostPosted: Sat Mar 12, 2016 6:35 am
by nyquist
I'm looking to use shell script and part of the code I want to use needs the folder name of the file.

If $1 is the name with full path: "/Users/Name/Documents/Movies/Movie_Name (2000)/Movie_Name.mkv"

What I want is a command that then will list "/Users/Name/Documents/Movies/Movie_Name (2000)/"

Re: Need to use $1 to find folder name

PostPosted: Mon Mar 14, 2016 12:14 pm
by Mr_Noodle
Check out the "dirname" command. You can do "man dirname" to get help on the commandline.