Need to use $1 to find folder name

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Need to use $1 to find folder name 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)/"
nyquist
 
Posts: 1
Joined: Sat Mar 12, 2016 6:30 am

Re: Need to use $1 to find folder name 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.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support