OS X - Operating System General OS operation information and support

Quick question regarding a shell script


Post Reply New Thread Subscribe

 
Thread Tools
Seventh

 
Seventh's Avatar
 
Member Since: Oct 10, 2009
Location: Boston, MA
Posts: 43
Seventh is on a distinguished road
Mac Specs: 27" iMac, 17" MBP, Mini x2

Seventh is offline
Hi folks,

I have a handful of shell scripts that I use to rsync a webserver that I run. Nothing fancy, just a one-liner in each of them. An example would be:

!/bin/bash
rsync -av /volumes/Macintosh\ HD/Users/me/Folder /volumes/Backup-Drive/Folder

The scripts run just fine if I copy/paste the rsync line into a command prompt, and all but one of them runs with a single click if I rename the files to .command so that they'll spawn on their own.

One of them, however, gives me an "operation not permitted" error:

Quote:
-bash: /Users/me/Scripts/script.command: Operation not permitted
logout
[Process completed]
I'm not entirely sure why. I've tried recreating the file, chmod 777 and +x, and for some reason just this one script refuses to run. If I paste the contents of the file into a terminal window, it executes just fine.

Anyone run into this? What am I missing? I've tried it with a !/bin/sh and a #!/bin/sh in front of it, and without the bash call altogether - same error.

Thanks!
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,534
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is online now
Your shebang (#!/bin/bash), malformed as !/bin/bash should return as something like..

line 1: !/bin/bash: No such file or directory

run a mount.. and make sure the FS you're running this on isn't noexec.

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks

Post Reply New Thread Subscribe


« safe boot mode and sound issues | Can my Mini handle Skype conference calls? »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Quick question about back-up using Time Machine khan0721 Other Hardware and Peripherals 3 05-04-2010 04:56 AM
Removing Duplicate emails in mail.app (Apple Script).. question notherand OS X - Apps and Games 2 08-13-2009 07:39 PM
Quick HTML Question iPod Nano Web Design and Hosting 21 08-02-2009 01:13 PM
Shell Script on Desktop starrin OS X - Operating System 2 07-28-2004 11:25 AM

All times are GMT -4. The time now is 04:46 AM.

Powered by vBulletin
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?