Shell Script - RAR

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

Moderator: Mr_Noodle

Shell Script - RAR Sun May 18, 2014 11:47 pm • by RedmondGuy
Help -- Relatively new to Hazel and relatively new to Mac in general, so sincere apologies if this is extremely basic stuff.

I want to use the command-line version of RAR to automatically move certain filetypes in a specific folder to a specific RAR file.

Let's say by way of example that the extension is .xyz, the folder is "~/Documents/XYZ Files", and the RAR file is "~/Documents/RAR File.rar"

I created a rule that says if extension is .xyz then run embedded script. I've put the rar folder in ~/Library and my script says:

~/Library/RAR/rar m ~/Documents/RAR\ File.rar "$1"

This returns an error code 6. I can open a bash shell and make the command work by hand.

I'm sure I'm missing something stupidly obvious. Any ideas what it might be? Is it the space character in the source folder name "~/Documents/XYZ Files"? That's why I put quote marks around $1.
RedmondGuy
 
Posts: 1
Joined: Sun May 18, 2014 11:36 pm

Re: Shell Script - RAR Mon May 19, 2014 2:59 pm • by Mr_Noodle
Turn on debug mode as noted in the sticky article above and see if there's any output from the script in the logs. Also, try specifying full paths.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support