Author Topic: shortcut User Folder Mac  (Read 1356 times)

j99mac

  • Full Member
  • ***
  • Posts: 35
shortcut User Folder Mac
« on: July 11, 2014, 01:54:13 PM »
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

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 1140
  • Professional Photographer & Software Developer
    • Hayo Baan – Photography
Re: shortcut User Folder Mac
« Reply #1 on: July 11, 2014, 02:09:23 PM »
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

  • Full Member
  • ***
  • Posts: 35
Re: shortcut User Folder Mac
« Reply #2 on: July 11, 2014, 02:15:57 PM »
Sort of I am now trying to get ~/ to work with Exiftools

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16724
    • ExifTool Home Page
Re: shortcut User Folder Mac
« Reply #3 on: July 12, 2014, 07:59:08 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).