A type of user interface for a computer. This can be both command line or graphical user interfaces. More commonly, shell often relates to the command line interface.

learn more… | top users | synonyms

3
votes
1answer
457 views

Printing the current date/time with sub-second precision

GNU date(1) understands the %N format spec, which outputs nanoseconds, so: $ date +%H:%m:%S.%N outputs 19:10:03.725196000 BSD date doesn't understand %N. How can I print the current time with ...
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 ...
3
votes
4answers
2k views

Using locate.updatedb doesn't work in Lion

A week ago I upgraded to Lion from Snow Leopard. I want to use the locate command, but the locate database has not been built yet. So I tried running sudo launchctl -w ...
3
votes
1answer
915 views

Search through terminal history with up and down keys in OS X Lion

After I upgraded to OS X I am not able to use my ~/.inputrc bindings to search through the shell command history: # these allow you to start typing a command and # use the up/down arrow to auto ...
1
vote
2answers
4k views

How to manage tunnels as background processes from a shell script?

I need to set up a couple of ssh-tunnels from a shell script. I've tried running them as bg tasks using: #!/bin/sh ssh -L 3000:server1:5029 me@server2 & ssh -L 3001:server3:3306 me@server2 & ...
4
votes
2answers
262 views

Is there a way to provide a sort order to an mdfind query?

In trying to get a list of all music files from a particular album using mdfind I see that the files aren't necessarily returned in any order. I'd prefer album/track order if possible, but can't find ...
2
votes
2answers
996 views

Bash shell script to locate and remove substring within a filename

I am trying to write a bash shell script (which is called by an Automator Action) to rename TV show DVD rips that I have named badly over the years. I want to remove part of the text in the filenames. ...
1
vote
1answer
275 views

Is it possible to install both Xcode 3 and 4 side-by-side, alternate use either one or the other

I've got a handle on how to install Xcode 3 and 4 on the same machine (running OS X < 10.7), so I'm looking more how to manage this environment. Rather: is it possible to enter some shell command ...
1
vote
2answers
547 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 ...
3
votes
2answers
365 views

Make locator.updatedb run daily on Snow Leopard w/o hacking /System/Library?

On Snow Leopard, the locate database is updated once a week by a launchd job, /System/Library/LaunchDaemons/com.apple.locate.plist. I'd like to make the updater run daily, but AFAIK it's considered ...
2
votes
1answer
292 views

Add info to Dock/Menubar from Shell in macOSX

I'm working on MacOSX environnement, but I would like to tweak it a bit. I have a few bash scripts I used in Linux to retrieve infos such as IP, average ping and so, that I would like to be displayed ...
3
votes
2answers
493 views

Identify connected external disks programmatically

I want to write a shell script that ejects all currently-connected external drives (either USB or Firewire drives). I can use the disktuil eject <disk-path> to eject a specified drive. But I ...
1
vote
3answers
541 views

Make a screen-shot and upload with a script

I am not very good with AppleScript but I would imagine this is something quite easy for the AppleScript guru out there, I am looking to make a screenshot of a region like with doing Apple-Shift-s and ...
1
vote
3answers
2k views

How to dim (and un-dim) display in automator

For those that are interested in the final script you can get it here original question I am trying to make a alarmclock script to wake me up. but I can't figure out how to change the screen ...
2
votes
5answers
5k views

How can I write a script to open multiple terminal tabs and execute code in them?

I want to be able to open the terminal application and have it either automatically run a script that opens several tabs and run an arbitrary set of commands in each. For example I would like one tab ...
1
vote
2answers
1k views

Change Account Password to Blank

I recently changed an account password by accident, and was wondering how to set it back to a blank password via the shell. I have root privileges. Please help :) passwd USER doesn't accept blank ...
1
vote
1answer
673 views

How to automate execution locate.updatedb by using a bash script

I am looking for a bash set of commands that will enable me to schedule the execution of /usr/libexec/locate.updatedb once every day. Please respond only with a set of command line commands, because ...
3
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
4answers
418 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 ...
1
vote
2answers
470 views

Why does ssh log me in as the wrong user?

I am shelling into my Mac (ssh) and get logged in with the wrong userid. There are three unprivileged user accounts on the system, and when I log in, I give my password, and whoami gives me either of ...
2
votes
1answer
155 views

Porting Linux shell scripts

The command shell$ ls . -R works on Linux but not on OS X. This is because OS X command line options have to come before the arguments,and not just anywhere as in Linux. In particular, this ...
1
vote
1answer
650 views

AppleScript app started prompting to run or quit. How can I disable this?

I'm not entirely sure why this has started happening since this is completely new behaviour and I haven't done any system updates but I have a nice little toolbar app for my Snow Leopard Finder.app ...
6
votes
2answers
5k views

Reset your PATH variable

I stuffed up (basically wiped) my PATH variable. Is there any way to reset it to the default? I look at How do I reset the $PATH variable on Mac OS X?, but I find it very confusing. As far as I ...
3
votes
2answers
2k views

open new terminal tab in the same directory with the active tab

In GNOME Terminal of Ubuntu when you open a new tab the new shell will automatically start you in the current working directory of the active tab shell. E.g. if in the active tab shell I am on ...
2
votes
3answers
813 views

Check if a process is running, if not execute it again in Terminal

Is there a way to periodically check if a process is running with (probably with Apple script, or some other shell script) and if not then to execute it in Terminal? I have a PHP script that is needs ...
2
votes
1answer
859 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
686 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).
7
votes
1answer
10k views

Bash or Zsh, what's the difference, why use one or the other?

So, the question pretty much says it all. I'm on Snow Leopard, and I do a lot of web development, particularly in Rails 3 which makes heavy use of the console. I've seen some notable bloggers etc. ...
10
votes
4answers
7k views

Is it possible to run Nautilus on OS X?

Is it possible to run Nautilus instead of Finder on Mac OS X Snow Leopard? How?
4
votes
2answers
222 views

Group running apps in OSX?

Since I'm working on several projects that require different resources (shells, files, chrome windows, etc), I'd like to organize them better. Is there a mac utility or something that will allow me ...
4
votes
3answers
818 views

Running .NET binary with mono

When I have abc.exe generated from C#/Mono source, I use 'mono abc.exe'. Is there a way to run abc.exe with 'abc.exe' not 'mono abc.exe'? I mean, when I run 'abc.exe', can I make 'mono abc.exe' ...