News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

shortcut User Folder Mac

Started by j99mac, July 11, 2014, 01:54:13 PM

Previous topic - Next topic

j99mac

I am working on a script in Mac OS X I am looking to have a short current for User. I know on Mac $HOME works to add the /User/UserID/ in a file Path.
This is what I have so far.

echo "Enter the file directory of Images Directory "
read input_variable
echo "You entered: $HOME$input_variable as Image Directory"
exiftool - "Make" $HOME"$input_variable" -r 

What do I need to chug to get the script to run with a shortcut so that I do not need to enter /User/UserID/ ?

Hayo Baan

I'm not sure I follow you, but if you are looking for a way to run a script without having to type the full path to it, you just need to put it in a directory on the PATH. Also, on the command line, the tilde ~ is a shortcut for the user's home directory. So ~/file refers to /Users/userid/file if the user is userid.

Does this answer your question?

Cheers,
Hayo
Hayo Baan – Photography
Web: www.hayobaan.nl

j99mac

Sort of I am now trying to get ~/ to work with Exiftools

Phil Harvey

The ~ is expanded by the shell, so it must not be inside quotes.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).