2
votes
5answers
131 views

Shell script help

I am new to writing shell scripts for Unix and need a little help. I am not sure why cURL now all of the sudden after running the script is downloading corrupts packages which cannot be mounted and ...
0
votes
1answer
32 views

How to iterate through multiple file extension without caring about case sensitivity?

I've seen various topics on how to iterate through multiple file extensions, but in most cases the list is defined. example: for file in ${arg}/**/*.{txt,h,py} do .... done As can be seen, ...
1
vote
2answers
32 views

How to run a script from Alfred or Spotlight or any run dialog?

Coming from Linux I am really missing the good old gmrun -- a run dialog which recognizes your $PATH and allows you to execute any script in it without needing to open up a terminal. It does the job ...
1
vote
1answer
69 views

Execute simple script

I wrote the following very simple script: route -n add 192.168.0.0/20 192.168.224.1 route -n delete 0.0.0.0 route -n add 0.0.0.0 172.20.10.1 And would like to just double click it and you ...
2
votes
1answer
71 views

Shell scripting: Why does only the “-” hyphen throw an error?

Goal: Cleaning up Selectively truncate filenames in my nvALT notes folder. I tried using a productivity blogger's suggestion (which eludes me after a thorough search) to prepend ^ > - + to ...
3
votes
3answers
152 views

Shell scripting: Select folder based on part of file name

My project I'm creating a bash shell script to execute from the Terminal. Its purpose is to archive lots and lots of project folders. Each folder follows a prescribed nomenclature: [YYYY.MM.DD] - ...
2
votes
1answer
250 views

How does this complex BASH shell script work?

Apple Support Community member Linc Davis developed this command to aide in diagnosing issues. The output gives a general overview of one's system and is very similar to the program etrecheck. But, it ...
1
vote
1answer
90 views

Script to check Software Version

Hi i'm tryin to write a script to check software version. I want to pass my own variables, which are name of the Application and Version. Here's a copy. It's not working for me currently... i'm a ...
1
vote
1answer
63 views

skill -KILL -u $user Command on Max OS X?

Is there an alternative for the skill -KILL -u $user command on the Mac OSx. The basic requirement is I want to log out my current logged in user at end of shell script This program logs out Linux ...
1
vote
1answer
43 views

How to script a logout while screen is locked?

I want to log out a user via a shell script, after a delay. However, there's a few other issues: User does not have admin and/or root. Logout must complete even if screen is locked. Currently, I'm ...
-1
votes
1answer
36 views

Seeking shell-scripting resources for the visual learner

I'm trying to teach myself shell scripting. I understand things best when I see them in the context of a system, especially when I can visualize that system. I'm looking for a visual companion to ...
1
vote
0answers
59 views

Correct Way to Check if Spotlight Has Indexed a Folder's Contents

Okay, so I've written a script that uses mdfind to more quickly match files, however, I need to find the best way to check whether a target directory is indexed or not, so I can fall back to using ...
1
vote
1answer
183 views

Unable to create a working .app executable using Platypus

I'm new to OS X and I'm trying to create an application wrapper for a shell script that starts a media server(Red5) I'm trying to wrap the Red5 server starter script (red5.sh) into an .app executable ...
2
votes
1answer
920 views

Trouble in Automator's Shell Script after OS X 10.9 Mavericks upgrade

I've got a problem. I use from lot of time an Automator's shell script: cat >> ~/Dropbox/ClipBoard/Appunti\ Mac\ del\ $(date +\%Y-\%m-\%d).txt It ever worked but, after Mavericks upgrade, ...
0
votes
1answer
106 views

SIPS: Only Resize if Image is 315x300?

I'm currently using sips --resampleHeightWidth 250 300 "S1" to resize new images in a folder but I think that it might be resizing images that were already resized.. Is there anyway to know this for ...
0
votes
1answer
191 views

Which background processes can I disable to speed up my Mac

If I'm on an old Mac and I just want the basics (web browsing, text editing, multitasking) to run a lot faster and I don't mind losing out on bells and whistles or temporarily disabling unneeded ...
4
votes
2answers
349 views

Pipe output of grep to a variable

I need to be able to write whether the test for a grep is either TRUE or FALSE to a variable so I can use it later For the following, if I run defaults read com.apple.Finder | grep ...
0
votes
2answers
3k views

line 1: syntax error near unexpected token `newline' with HTML + shell script

I've been learning the shell with a great tutorial, linuxcommand.org. After a lot of learning and practice with navigating directories, editing files, etc, I've moved on to writing shell scripts. One ...
0
votes
1answer
1k views

Automator won't execute my bash shell script

I have a bash script that works like a thread. Now I'd like to turn it into a service with Automator. Input is set to Image Files in Automator and the shell script action is set to Pass input as ...
0
votes
1answer
120 views

Simple Script for URI Handling

Basically what I'd like to know is how can I setup a shell script (or an Applescript or Automator wrapper for a shell script) as a protocol handler for a custom URI (so clicking them will trigger my ...
1
vote
1answer
279 views

Automator to execute shell script with an input text file, copy it to specific directory

I'm simplifying making a .deb file with Automator. I currently have a shell script that does some simple actions - Ask the user for text input Do some directory parsing Execute a command with the ...
1
vote
2answers
729 views

My Automator Workflow fails because it fails to find the git command within the 'Run Shell Script' command? Need help

I have an Automator workflow and one of the actions is to clone a repository. Here's the code for the 'Run Shell Script' action. The command is run within the Bash shell /bin/bash if that matters: ...
1
vote
2answers
1k views

How to Run Shell Script upon Application Launch?

Not sure if this belongs here or on SuperUser, but it's Mac specific, so I'll go with here. I wrote a Ruby script that edits TextMate's global properties file and changes the theme based on the time ...
2
votes
3answers
1k views

How to determine the absolute path to a file in a shell script

I am writing a generic script that can get passed both absolute and relative (to the current working dir) paths to existing files. I need a fail-safe way to turn all those passed paths into absolute ...
3
votes
1answer
133 views

Detecting that a script is run within ARD

Does anyone know of a way to detect that a shell script is running within ARD (vs. running the same script locally on the machine)? I looked at detecting that we are running in interactive mode - ...
2
votes
1answer
2k views

How can I open Google Chrome in Presentation mode using a shell script

Previously in 10.6.8, I was able to start Google using open /Applications/Chrome.app --args --kiosk http://www.google.com Now, on newer systems, that does not work anymore correctly. The only way to ...
0
votes
1answer
161 views

Script to Update/download most recent iTunes podcast WITHOUT opening iTunes at all?

I have a couple favorite podcasts that I subscribe to in iTunes. I'm using You Control (so I don't have to open iTunes to play my music). I'm using Keyboard Maestro. I've made a macro that runs ...
1
vote
1answer
142 views

logger vs syslog -s

What exactly is the difference between using logger and syslog -s? According to its manpage, logger provides interface to the system log module, but I can't really see the point given that syslog(1) ...
2
votes
3answers
489 views

How can I see how long my computer has been active (as in not idle)

I've seen a variety of solutions to check how long my machine has been idle, and I know I can check how long since last reboot with uptime, but I'm curious if there's a way to see how long since my ...
1
vote
2answers
2k views

How do I run an OS X command script on remote Xserves from a desktop OS X script?

The answer to an earlier question, Access and control home office network, iMacs, and Xserves, left me with a new problem. To review, I have a computing environment comprised of: 27" iMac with dual ...
1
vote
2answers
905 views

What is your preferred way to start a (shell) script from the GUI?

I was wondering what ways there are to start a (shell) script from the GUI, e.g. double-clicking an icon in Finder or launching via Spotlight. This is not about opening a terminal and "manually" ...
2
votes
3answers
1k views

Inserting shell script into .app bundle

I'm trying to shoe-horn a shell script into an application bundle so that the shell script will be run when I open the bundle, as opposed to the executable put in there. Specifically, I'm trying to ...
1
vote
2answers
633 views

find video codec from terminal

I'm writing some shell scripts that automatically convert some video files. Except I don't want to run the conversion on files that are already h264 encoded. Is there a way I can tell via a terminal ...
5
votes
3answers
2k views

Opening a terminal window to a specific directory from a bash script

How can I write a bash script in Mac OS X that opens a Terminal window in a specific directory? I'd assume something like: open /Applications/Utilities/Terminal.app But that does nothing (maybe ...
1
vote
5answers
449 views

opening an app in a shell script with sudo

I'm trying to open an app that listens to port 25 within a shell script. In order to listen to port 25, I need to run the app with sudo. So I tried the following: sudo open appThatNeedsPort25 It ...
2
votes
1answer
935 views

Why won't wget work with cron?

I've been using the bashpodder script (http://lincgeek.org/bashpodder/) recently, and while the script works beautifully when I use it in the command line, the crontab I created for it doesn't work at ...
0
votes
2answers
6k views

Automator choose finder folder and run shell script

I've got a simple shell script that I would like to incorporate into an automator workflow. I just need to double click the application , pick a finder folder and run the command. At the moment it is ...
1
vote
2answers
729 views

How do I use a keyboard shortcut to execute a shell script I wrote, passing the file selected in Finder as an arg?

I suppose you could have it pass in whatever was selected in general in any app (such as text highlighted in a web browser).