0
votes
1answer
51 views

Run a script only at shutdown (not log off or restart) on Mac OS X

Is there any way to run a script only at shutdown? I mean, only when the computer is really shutting down to off state. This script should not run when doing just a log off or restart.
0
votes
0answers
12 views

Determine missing files after XML to Json conversion

I want to do some analyses on this files, using a big data approach. After converting my entire Batch of Files from XML to JSON (Over 100k Files, divided in 2 Folders) I realized that in the first ...
0
votes
0answers
35 views

Tools to create a 'GitHub' style index page for files/folder on a fileserver?

My workplace doesn't have a document management system. People just throw files on a shared fileserver, where search doesn't really work. Trying to find information/files for a particular project by ...
0
votes
0answers
14 views

(MAC) Change location of shell script's shell

When I make an executable shell script ("http://chimpy.wordpress.com/2010/08/29/mac-os-x-shortcut-link-to-python-script/", but without the python part), It's pointer location (The location commands ...
0
votes
1answer
158 views

What can I do about “cannot execute binary file”

I have a little shell script that simply starts up a Java program. It is installed somewhere deep in the hierarchy, so I don't want to add its containing folder too my path. So I put a symbolic link ...
0
votes
1answer
97 views

Eject all disks and dmg's with Automator script in Mac OS X

I have created an Automator Service to eject all disks in Mac OS X. find /dev -name "disk[1-9]" -exec diskutil eject {} \; This works, but I still receive an error message afterwords: "The action ...
0
votes
2answers
147 views

Batch file rename script swapping substrings in filename?

I have a group of files named like title_december_word1_word2.png and want to iterate through the directory and swap word1 and word2 within each file. i.e. go from button_december_state_pressed.png ...
0
votes
1answer
95 views

Automated git push attempt does not work - authentication issue

I'm trying to automate a very periodic git add/commit/push cycle using a shell script and cron under OS X 10.8.5. The script is as basic as one would expect it to be: cd /my/directory git add . git ...
0
votes
0answers
179 views

Crontab command set not working

I'm trying to set up crontab to run a shell script, but for some reason, the script doesn't get executed. I'm on system with OS X 10.8.5. crontab file 0 12 * * 1 /absolute/path/to/myscript.sh 0 15 * ...
1
vote
1answer
275 views

Capturing output of .bat script in VMWare Fusion 'runProgramInGuest'

I've recently started a new job where we run virtualized copies of Windows inside VMWare Fusion (Mac OSX is the host). Among other things, we have a few utility .bat files that get run regularly. I'd ...
0
votes
1answer
176 views

Can you switch into Single User Mode Without Rebooting?

Is it possible to switch into single user mode WITHOUT rebooting and holding CMD+S. For example, can I write a shell script to switch into single user mode? If so, for which operating systems?
0
votes
1answer
45 views

Script to copy files to x locations of rules are met

I would like to create an automator script that will ask me for a specified folder, and on selection I would like it to search for the following and do x tasks if files is .mkv and does not contain ...
1
vote
0answers
63 views

allowing timeouts for commands that have no timeout option, where `IFS=$'\n'`

In the lines below, which I added to my copy of Apple's sysdiagnose script: wherever a timeout is already scripted, it is effective I must add timeouts in two areas, but I don't know how to do so. ...
3
votes
1answer
2k views

How do I close a window from an application, passing the file name?

I’m trying to produce an Applescript-based shell command that tells the Preview application from Mac OS X to close a particular window. #!/bin/sh osascript <<EOF tell application "Preview" ...
7
votes
1answer
314 views

How to change the appearance of empty folders in finder using Automator?

I'm trying to use Apple Automator to label empty folders in a heirarchy. Basically, I start off a project with a heirarchy of empty folders and fill them as I work. I want a workflow to label all ...
0
votes
1answer
52 views

Documenting software-updates semi-automatically in MacOS X by parsing log files?

I'd like to document changes I made to my computer (running MacOS 10.6.8) to be able to identify the sources of eventual problems. Mostly I install updates when a software notifies me about a newer ...
0
votes
1answer
500 views

How do I create a “here document” within a shell function?

I'm working my way through William Shotts Jr.'s great The Linux Command Line on my Mac OSX 10.7.5 system. 90% of the linux that Shotts covers is close enough to Darwin that I can figure out or GTEM to ...
0
votes
1answer
454 views

Unix shell script - cp -R doesn't copy contents behind symbolic links

I've got this ./image folder full of symbolic links to "real" folders. These "real" folder contain a series of images. ./image/stones -> somefolder/stones ./images/grass -> ...
2
votes
1answer
816 views

How can I tell if the lock screen is active from the command line on OS X?

I have a cron script that I want to run regularly if I am logged into my Mac. I don't want it to run if the Lock Screen is up. Is there a way to check from the command line / Terminal if the Lock ...
1
vote
1answer
85 views

Why aren't my if statements going through?

I am creating a bash script that is suppose to copy all files in ~/Development/ to another computer on my network. I have enabled it to mount the computer if it is not there, but my real problem is ...
2
votes
3answers
378 views

Batch combine two files in Unix

Does anyone know how to batch prepend one audio file to another audio file and create a separate output for each. E.g. Files: Static.wav Audio1.wav Audio2.wav Audio3.wav I need a script that can ...
4
votes
1answer
2k views

Reading values from plist nested dictionaries in shell script

I have a plist file and I'm interested in fetching values from nested dictionaries using shell script. Here is the structure of my plist file: <dict> <key>Countries</key> ...
0
votes
1answer
529 views

cp: fts_open: No such file or directory error

I have this script: #!/bin/sh -x /bin/echo "Drag folder into Terminal and hit return ->" /usr/bin/read folderLocation /bin/cp -R "$folderLocation" /Users/my/Desktop/ And it ...
1
vote
2answers
50 views

How can I send an auto connect feature packet in OS X?

I am trying to configure auto connect feature on my router. It auto connects on a trigger packet. I need to provide the information of trigger packet. I need source port, destination port and protocol ...
0
votes
2answers
107 views

OS X - detect UPS going on to battery

is it possible to get notification from OS X (10.5 Leopard or higher) that the UPS has gone onto battery - i.e. are there any notifications or system config changes I can monitor? If it's possible ...
0
votes
1answer
273 views

Opening and passing arguments to an application using a shell script on a Mac

I am trying to write a shell script on a Mac which opens RIATest and passes it parameters. My code is: #!/bin/bash echo THIS TEST!!! open -a '/Applications/RIATest 4/RIATest.app' --args /b /r /e 5 ...
0
votes
1answer
2k views

Automatically close Terminal after script execution

How do I automatically close the Terminal after script execution? #!/bin/bash cd ~/Desktop/sh-scripts/ ./start.sh & // ??? how to close Terminal
1
vote
2answers
57 views

How to automate changing my ip?

I am very new to OSX. I will use my MBP at work and home. I would like to be easily able to switch my ip when changing location. Thus far I have dabbled with the automator, hoping to do something ...
0
votes
1answer
61 views

Execute Script when leaving a window

is it possible to execute a Script (Applescript/Shellscript) when I leave a window (and when I switch back to it)? What I want to do: I want to pause my VM when I leave the VM-Window (vmrun pause ...
-2
votes
0answers
49 views

Create an executable from a shell script in OS X [duplicate]

Possible Duplicate: Can I create a configuration file for a shell script? I need to create an executable from shell (.command) in OS X, with parameters. Example: backup -s1 -s1 is ...
2
votes
1answer
612 views

Run HTML Tidy in batch on Mac OS X?

I want to run HTML Tidy on a large number of files located in folders and subfolders. I can use the following command in Terminal to run it on a single file: tidy -f errors.txt -m -utf8 -i ...
0
votes
2answers
557 views

Downloading files from FileSonic via terminal without a premium account

I found various blogs on the internet about how to download a file from FileSonic, Hotfile, Rapidshare, etc. from a Linux terminal if you have a premium account. Is there any way to download a file ...
1
vote
0answers
1k views

Macintosh OS X Logout Script

I am working on a project where I need to implement a logout script on some Macintosh computers. I have read the following Create a logoff script/task for Mac OS X article and found that while it is ...
6
votes
5answers
8k views

Run a shell script on OS X without having a terminal window appear?

I'm trying to set up a few keyboard shortcuts that open specific iTerm sessions, which I was able to do with BetterTouchTool and a bit of AppleScript magic. The problem is that OS X insists to open a ...
5
votes
6answers
331 views

Find all filename.ext1 where no filename.ext2 exists in OS X or the shell

I need to create both TIF and JPG versions of a large set of images. All JPG images already exist, but only a part of the TIF images. Is there an easy way to search a directory to find all JPG files ...
2
votes
2answers
2k views

Moving files and renaming when a file exists in destination folder

I used to do this with Hazel. I'd move everything from ~/Downloads/ to ~/Downloads/Archive/Pictures, Documents, Videos etc. based on the file extension, and when a file with an identical name already ...
2
votes
1answer
5k views

Shell script to check if file exists in user home

I want to check if the User home on OS X has a file environment.plist in .MacOSX folder and if this file exists then append some new key values into it. But if it does not exists then create this ...
2
votes
4answers
1k views

How can I find the PID of a process using its command line arguments?

I'm using Mac OS X, which means I don't have (for example) pgrep/pkill, but I want something like that (I don't use macports/fink, either - homebrew is my Unix package tool of choice - so packages ...
3
votes
1answer
1k views

How do you run a shell command/script automatically when entering/cd-ing a directory on Snow Leopard?

Apologies if the answer to this is obvious, but I haven't been able to find one yet (perhaps because I'm searching with the incorrect terminology). I am on a Mac running Snow Leopard and I would like ...
2
votes
2answers
748 views

Finding the WiFi network name (SSID) in OS X via shell script

How can I find the WiFi network name I'm connected to on Snow Leopard via shell script?
0
votes
3answers
307 views

Get folder with largest number at the end of the name in Linux and OS X

I asked this question yesterday with Linux, but I realized I need to get it working in both Linux and OS X. Link to earlier question: Get folder with largest number at the end of the name in Linux. ...
1
vote
1answer
1k views

How can I execute a shell script without exit? (Mac OS X)

I'm making a shortcut icon on my Dock which opens a terminal window with some preconfigured environment variables. I made a script and dragged it into my Dock. It runs well, however it exits ...
4
votes
2answers
266 views

Use of '#!' in *nix scripts

In many Apple/Unix scripts I see stuff preceeded by '#" which as far as I know means it is a remark. However often you see shell calls as below (the line with #!). ## Setting a default route ...
2
votes
3answers
3k views

Run Script every 30 Seconds on Mac

I have created a cronjob that runs every 60 seconds which is not frequent enough for me. It is a simple command: wget localhost How can I run this commenad every 30, 16 seconds on my mac?
0
votes
2answers
1k views

Run a script automatically when I'm connected to the internet on Mac [duplicate]

Possible Duplicate: Run script in OS X 10.6 on network connection. (like /etc/network/if-up.d/) I set up ssh tunnels so that I can access various computers at work through our gateway. The ...
1
vote
2answers
123 views

osx shell terminates after using

I have a shell script that changes directory and then runs. I want the directory change to be bubbled to the command prompt once the script terminates. So, I run it with: . script However, now ...
6
votes
4answers
4k views

Run script in OS X 10.6 on network connection. (like /etc/network/if-up.d/)

Is there any way to run a script when a network interface comes up in Mac OS X? I've tried putting a script named ip-up in /etc/ppp but it doesn't seem to fire when I disconnect and reconnect to a ...
1
vote
2answers
478 views

find shellscript execute command for every file

I found "find" command is much faster than "Spotlight" in mac os x i rather visualize the results with automator with no luck so I hope geeks around SU will help with solution about that a ...
3
votes
4answers
3k views

Shell script Mac OS X App : get its path

In Mac OS X, from a shell script application's point of view, how can I get its bundle directory path for use in a shell script? When using the env command, it returns that the app's execution path ...
9
votes
3answers
10k views

Determine the architecture of a Mac from the command line or script?

I'm writing a shell script, and I need to know the architecture, i.e. PPC or Intel. Back in the day, there was a program /bin/arch that told you, but my mac doesn't seem to have it... Is there an easy ...