The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

2
votes
3answers
2k views

Alternative to APLAY for Mac OS X bash

Anybody knows any Mac alternative for Linux's APLAY program? I would like to run this script: echo ...
3
votes
1answer
116 views

How do I generate cryptographically random numbers on OSX?

I need to generate several cryptographically random numbers in OSX and save it to a text file. How should I go about doing this?
8
votes
2answers
3k views

Is there a Mac OSX equivalent of zenity?

I'm porting some simple X windows/bash scripts to Mac OSX, but I cannot find a build of Zenity (a Gnome app for basic GUI dialogs) for OSX. Is there some other command line driven dialog utility I can ...
3
votes
1answer
117 views

Launch a bash script from the dock

I can't seem to figure this one out, there must be some really easy trick. I have a bash script which sets my environment for an app and launches it with the correct parameters. How can I put this ...
2
votes
2answers
282 views

“sed” or “awk” launched on opening terminal window

At some point, I've noticed strange behavior of Terminal app - now on opening new window i get this as normal: Last login: Tue Nov 27 11:54:21 on ttys001 but can't see the "~" sign afterwards and ...
4
votes
1answer
256 views

declare -x messages appear in my terminal. How can I get rid of it?

declare -x Apple_PubSub_Socket_Render="/tmp/launch-qoybJQ/Render" declare -x Apple_Ubiquity_Message="/tmp/launch-DWchNf/Apple_Ubiquity_Message" declare -x COMMAND_MODE="unix2003" declare -x ...
1
vote
4answers
252 views

Opening a file with command-line bin through Finder

I wish to use mp3blaster (installed through MacPorts) via Finder. I want to double-click an mp3 file and get it opened in mp3blaster. But I haven't been able to do so. I created an app and, in another ...
0
votes
2answers
666 views

How to change mc (midnight command) bash prompt on OS X?

I observed that my custom bash prompt does not work on mc. How do I customize it?
4
votes
1answer
2k views

Set default shell to MacPorts bash in Mac OS X 10.6.8?

As a follow up to my previous question, I reinstalled my MacPorts and want to try its newer version of bash again. I installed the newest bash via MacPorts on my Mac OS X 10.6.8 system, but when I ...
1
vote
2answers
408 views

Terminal and bash can't start with libiconv error

I just tried to start Terminal.app in Mac OS X 10.6.8, and got the following error: dyld: Library not loaded: /opt/local/lib/libiconv.2.dylib Referenced from: /bin/bash Reason: Incompatible ...
1
vote
2answers
838 views

Why sh -c 'echo -n 1' is different from bash -c 'echo -n 1'

I am on a Mac Book Air, OSX 10.8. I am trying to understand why these two snippets do not print the same output. sh -c 'echo -n 1' outputs -n 1 whereas bash -c 'echo -n 1' outputs 1 as expected. ...
1
vote
1answer
253 views

How can I make autocomplete in the shell work with case-folding?

How can I make the autocompletion for files and folders in the bash shell work case-insensitively? Ideally, cd ~/doc + tab autocompletes to cd ~/Documents (correcting the case as it autocompletes), ...
1
vote
1answer
293 views

How do I launch shell applications after changing shell to MacPorts bash?

I have installed a current bash version via MacPorts and changed Terminal.app to use /opt/local/bin/bash. Unfortunately shell applications won't launch from Finder and Spotlight anymore. (OSX 10.8.2, ...
3
votes
3answers
912 views

How did my Mac end up with iPhone 4S as my host name in the user prompt in OS X terminal?

The other day I was searching for Xcode iOS 5 tutorials. About a day or two later, I noticed my terminal prompt is now "iPhone4s : myusername". Naturally , my biggest fear is that there could be a ...
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) ...
8
votes
2answers
1k views

mount is adding a quarantine flag, causing: /bin/bash: bad interpreter: Operation not permitted - but not the usual suspects

OK, I'm having a similar problem to: -bash: Applications/mvim: /bin/sh: bad interpreter: Operation not permitted - but it's not the same problem. I'm getting the same result. I've already verified ...
5
votes
3answers
7k views

How is my $PATH variable built in Mountain Lion?

I've recently installed Homebrew on my Mac and it's complaining that /usr/bin occurs before /usr/local/bin in my $PATH variable, meaning that system-provided programs will be used instead of those ...
2
votes
1answer
353 views

Copy contents of a smart folder to a new folder in Mountain Lion

I admit that my music collection is a royal mess. This is the result of merging many sources of music (external drive, old iPod sync, iTunes purchases, etc) into my iTunes account. iTunes Match has ...
5
votes
2answers
532 views

How can I have my shell always start in a certain directory that is not my home directory

I've tried putting cd /Users/my_name/my_directory/structure in both .bashrc and .bash_login but neither works, i.e. when I open a new terminal window I am in my home (/Users/my_name/) directory. ...
0
votes
3answers
432 views

I have lost the prompt on Terminal on my Mac; unable to get commands to work

I was trying to launch a few Java applications using the terminal. The command that I was instructed to launch it with (I was following a guide) was the following: #!/bin/bash cd "$( dirname "$0" )" ...
7
votes
1answer
2k views

How can I format the output of ping in bash?

I am using the following script to cycle through a list of IP addresses and report back on the % of packet loss. I'd also like to have the IP address printed first, then its % of packet loss. But I ...
4
votes
4answers
9k views

Change Command Prompt - Variables are literal, and changes to .bashrc or .bash_profile not making a difference

Trying to change my command prompt in OS X 10.8 / Mountain Lion. Changes to ~/.bashrc and ~/.bash_profile do not make any difference. Like: export PS1="\W \$" It defaults to the host name ("\h\%"). ...
0
votes
1answer
153 views

Getting .profile to execute after .bash_login

When I installed RVM, it turns out that it created .bash_login with this: [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session as a function ...
0
votes
1answer
340 views

How can I set and use a PATH component with blanks in bash?

I have Mathematica 8 installed on my OS X Mountain Lion laptop. I want to set my PATH so that I can run either MathematicaKernel or Mathematica from the command line. To this end I have configured my ...
1
vote
2answers
1k views

How to fix locate.updatedb not respecting directory excluded from /etc/locate.rc?

I wanted to exclude some directories from the results of /usr/libexec/locate.updatedb by editing /etc/locate.rc. Unfortunately if I edit locate.rc locate.updatedb runs forever and does not actually ...
4
votes
2answers
682 views

How to reset the terminal before command execution?

I've been looking at spicing up my Terminal experience by among other things, adding some color. I used the tput command to build a nicely looking prompt. This is part of my .bash_profile: ...
1
vote
1answer
542 views

Set terminal window title in a script

I would like to change the entire title of the terminal window for a particular bash script. I googled out but I couldn't find much more than this suggestion: printf "\e]0;My Custom Title\a" After ...
2
votes
1answer
1k views

How do I batch set the files “date modified” to the “date created”?

I have a folder with a bunch of photos taken by two different cameras, with one camera having been set to the wrong date. I managed to correct the EXIF date using Picasa (see photo.stackexchange), but ...
1
vote
1answer
375 views

How can I set Last Modified Date of file after using HandbrakeCLI to convert a file?

Running this on OS X Lion. I'm batch converting several hundred home movies using Handbrake CLI. I'd like to set the last modified date and created date to that original file. I'm using the ...
0
votes
1answer
226 views

Can't create alias for 'nano ~/.bash_profile'

I tried to make an alias to edit my bash profile, but when I save and relaunch a new window, I get the following: Last login: Sun Jul 22 12:00:25 on ttys001 -bash: alias: nano ~/.bash_profile: not ...
0
votes
1answer
293 views

tmux on Mac, how can I enable vi mode for the command line

I want to be able to hit escape and then use vi navigation keys like b (back a word). I can do this in my regular terminal sessions by setting set -o vi in my .bashrc file. However it's not working ...
2
votes
2answers
1k views

How do I install a2ps for better printing?

How do I install this program so that I can do postscript printing? Currently I get -bash: a2ps: command not found
1
vote
3answers
112 views

At the command line, how can I 'arrow along' faster using words instead of chr's

I am at the command line and I have . /this/set/of/directory/this_command "parm1", "parm2", "parm3" When I 'up-arrow' to recall previous lines, how can I move along the line from "word to word". ...
6
votes
2answers
750 views

Change my shell to a different bash version at /usr/local/bin/bash?

How can I set my /usr/local/bin/bash (which is the 4.2 version that allows auto-completion of 'cd to directory with directory name') to be my default bash for a new window instead of my regular ...
0
votes
3answers
1k views

Change owner for all files owned by x

I copyied files from my MacBook, mainly files from /usr. The one and only user on my computer is called 'Julian' (like on my MacBook). A lot of the copied files are now owned by '501' (id of "Julian" ...
50
votes
3answers
19k views

git auto-complete for *branches* at the command line?

On my linux machine I have autocomplete for branches with git. For example I can type git checkout [TAB] and get a list of branches. Or I can type git checkout feb* [TAB] to get all branches that ...
0
votes
2answers
667 views

Executing program through Terminal

I have Sage (math program) and I want to execute it through terminal. I know I can go to the directory and execute it with - open Sage.app But would I really want to do is simply type sage in ...
2
votes
1answer
518 views

Why doesn't the screen command source my .profile?

When I start a new screen, the aliases that I have set in my ~/.profile do not seem to be sourced. Does anyone know where I can change this or which file is actually read when starting a new screen?
0
votes
1answer
835 views

How can I start postgres automatically on startup?

I can start postgres with: # Start Postgres /usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start Where can I put that to start up when I start the machine up? I can put it in my ...
11
votes
2answers
1k views

cd to a directory by typing its name?

For example if a directory 'blob' exists and I just type 'blob[return]' then the system cds into the blob directory for me. In Linux (Ubuntu) I can add shopt -s autocd to my .bashrc file, but on OS X ...
1
vote
1answer
73 views

.bash_profile not running with multiple commands

I am having an issue with my .bash_profile script. If I simply have the line source ~/sh/bashmarks.sh the bashmarks.sh script runs as expected. However, if I add an alias source ...
2
votes
2answers
320 views

Need a bit of help running a couple lines of bash in applescript. Maybe straight bash is best?

Preface this by saying I will be launching this script whether it be applescript or bash script with Alfred.app. Sorry to be so blunt and unknowledgable but I need to run a couple lines of bash in an ...
0
votes
1answer
770 views

cd 'brew --prefix': no such file or directory

After these errors: > brew update fatal: 'origin' does not appear to be a git repository fatal: The remote end hung up unexpectedly Error: Failure while executing: git pull -q origin ...
0
votes
1answer
688 views

Can't get commands inside .bash_profile startup script to run

From my bash shell (latest version of Lion) if I issue the command... source ~/sh/bashmarks.sh The bashmarks.sh script will run and the functionality it provides is available. However I don't want ...
1
vote
1answer
342 views

How to add a directory to my path that includes a colon and a space?

I installed MIT/GNU scheme and am trying to add the directory to my $PATH variable so that I can run it from Terminal. The app name MIT:GNU Scheme.app is a veritable "perfect storm" (for path names) ...
3
votes
2answers
4k views

Bash commands that work on an iphone

I've jailbroken my phone, and I'd like to execute some commands on it from my phone, namely, the Say command. That, unfortunately, does not work. What commands COULD I execute on the iphone, other ...
7
votes
4answers
3k views

AppleScript vs. Bash script?

I'm a long-time Windows "power user" and developer who has recently decided to move over to Mac OS X. On OS X Lion and indeed previous versions there seem to be two main options for scripting and ...
4
votes
3answers
2k views

Is it possible to have bash escape spaces in pwd?

I'd like to copy the current directory to the clipboard, something like: pwd | pbcopy. However, pwd does not escape the space, so something in "Application Support", for example, doesn't copy ...
2
votes
1answer
427 views

This script randomizes a MAC address--but I cannot renew DHCP afterwards

#!/bin/bash NEWMAC=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'` ifconfig $1 ether $NEWMAC ifconfig $1 down ifconfig $1 up I pass en0 or en1 as the sole argument to the script and run as ...
0
votes
0answers
1k views

using -exec command on mac os x

Does any know why the -exec does not work on mac os x lion terminal? It works on linux and other variants but not on mac os x find / -iname "*.mp3" -exec mv {} /mnt/mp3 \;