The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

0
votes
1answer
45 views

Python launching problems OS X

I'm trying to install python on mac OS X 10.7.5. I installed it from MacPort and I think before I did, I screwed up $PATH somehow. It seems to install fine but then when I try to run ipython I get ...
0
votes
1answer
689 views

How to enable Maven autocomplete on Mac OS X command-line?

When using Maven (mvn) on OS X Terminal, how can I get tab-completion for Maven goals, plugin names, etc? Things like this: mvn pa [TAB] -> mvn package mvn je [TAB][TAB] -> mvn jetty:run
2
votes
1answer
71 views

How to get inode from alias file?

In this MacWorld forum thread aliases are described as Aliases can reference an object in the file system either by a persistent ID or by path. Generally they will contain both pieces of ...
2
votes
1answer
659 views

How do I edit current shell command in VI

I have seen in blogs on Linux machines you can edit the current bash shell command in VI (or whatever the EDITOR is set to) by pressing ctrl-x,ctrl-e. This doesn't seem to work on 10.8. Any ideas on ...
5
votes
1answer
72 views

Weird line wrapping in terminal with a colored prompt

I have reason to think I've got improper escaping in my bash prompt (I get weird random line wrapping in Terminal). Can anyone point it out? It looks OK to me... export PS1="\033[0;35m\u\033[00m on ...
1
vote
1answer
345 views

Run script on networked user login

The computer lab is running 10.8. I would like to run a script when networked users login. As far as I can tell my choices are: launchd agents - Not meant for this. On the launchd.plist man page it ...
9
votes
5answers
483 views

How to share .bashrc files between two mac user accounts

I have set up two user logins on my computer, one for home and one for work. I would like to be able to share any of my bash and vim settings between the two users. Is there anyway to do this? Thus ...
1
vote
3answers
1k views

Find/Unrar/Delete Script

I'm a PC convert, and quite novice when it comes to shell/bash scripting, but I really want to learn/understand more. My need: I need to be able to scan a folder, find any .rar files, extract the ...
6
votes
2answers
570 views

“Airplane Mode” in OS X. Alternative command for `rfkill`?

This question is an exact duplicate of this post from superuser.exchange.com. I believe this is a valid question for both of sites and hope I am not (if any) violating stackexchange policies. ...
4
votes
1answer
132 views

Can an alias be added to the dock via the command line?

I found this article but it handles the GUI solution. I would like to automate the setup of a new machine, and do that I've created Dropbox shares of a number of my common configurations. (I could ...
1
vote
1answer
198 views

Alt-. and vertical bar (pipe) on terminal

On linux consoles I always use Alt + . to get the last argument of the previous command in history. for example if I had ls /tmp/test as last command, and if I type rm Alt - this will result ...
0
votes
1answer
32 views

Equivalent to Alt on terminal [duplicate]

On linux consoles I always use Alt + . to get the last argument of the previous command in history. for example if I had ls /tmp/test as last command, and if I type rm Alt - this will result ...
2
votes
1answer
202 views

how to get ls to list files in case-insensitive order?

How do I get the ls shell command to list my files in: case-insensitive order with the directories at the top? The reason I ask is: I want Aquamacs Emacs dired to list my files and directories ...
3
votes
3answers
287 views

Compare multi-digit version numbers in bash

Trying to write a script that searches for the version of the Application then returns the value. My problem is the value is three to four intergers long (example 4.3.2). I have searched for a while ...
2
votes
1answer
204 views

Paste <TAB> into Mac OS X command line

I want to paste <TAB> into command line, in order to execute cut command with <TAB> as the delimiter. Everytime I try to do it, it simulates clicking the tab key and completes the command ...
0
votes
1answer
522 views

Load .bash_profile automatically on Terminal.app startup?

I have seen various questions that ask something similar. They suggest changing .bash_profile to .profile. However this doesn't work either. I have aliases setup up in .bash_profile. I would like ...
1
vote
1answer
843 views

How to set up multiple PATHs in the user bash_profile in OSX 10.8?

I am looking to set up my laptop for both Python development and Phonegap Android development in OSX 10.8 using Eclipse. I installed the lastest version of Python (3.3) which added the code: # ...
0
votes
2answers
411 views

Applescript dialog, Bash alias/function

I'm trying to create a short alias for creating System dialogs from the Terminal. I tried to create a Bash function (since an alias didn't seem to take arguments) and add it to my .bash_profile, but ...
1
vote
1answer
44 views

How to change some information in a shell prompt.

I opened my terminal and saw a shell prompt. Last login: Fri Feb 15 15:28:16 on ttys000 john:~ voloda2$ How do I change john to alex?
3
votes
1answer
84 views

How to find delay when launching new Terminal (iTerm)

When I press CMD+N in iTerm2 to bring up a new iTerm window, sometimes it takes 10 seconds before I get my prompt. If I immediately repeat the process, the whole thing takes 1 second. To me this ...
0
votes
1answer
40 views

Terminal not logged in properly

I'm having a bit of an odd issue with my terminal. I'm used to the prompt being Joosts-Macbook:~ Joost$ or something of that nature, but all of a sudden it displays a number I don't recognise: ...
1
vote
0answers
58 views

Most efficient way to get all files in a directory

I have a million+ files spread across four fiber-connected arrays. I need to get the path, filesize, and last_modified date to insert into a mysql database. What would be the best way to do this? ...
4
votes
3answers
2k views

How to run a bash script from the desktop?

I have a .sh file with a #!/bin/bash header. I'm able to run it from the terminal, using chmod and ./ but is there a way to perform these two operations from the desktop (i.e. by clicking on it) ? ...
2
votes
2answers
751 views

Source a script from a URL in bash

I gather this should work in bash: source <(curl -s https://example.com/script.sh) or bash <(curl -s https://example.com/script.sh) or curl -s https://example.com/script.sh | source ...
1
vote
1answer
57 views

How to invoke a script when closing any file with a given extension

Is it possible to automatically invoke a given applescript when closing -any- file with a given extension in a specified folder (and subfolders)? If not in AS, is this possible in bash? (The AS I am ...
5
votes
2answers
2k views

How to reset $PATH?

I was trying to add something to $PATH and it went totally wrong. I now can't run any commands such as ls. I've looked at this answer and used the following lines: ...
0
votes
3answers
343 views

Setting a variable to the result of a terminal command within an applescript

I'm trying to make a script that ejects all connected external drives and does not move on until they are all disconnected. The main problem I'm having is being able to set the variable vol_count to ...
1
vote
1answer
66 views

How do I verify the integrity of my OSX installation? (Files, versions, and preferences)

I want to verify the files, and configuration settings for my OSX installation against a known good reference "base". Assuming I have two identical Macs (hardware), with one being factory installed ...
3
votes
2answers
269 views

How to drop a file onto a GUI app from command line?

I've got a tool to normalize WAV audio files, but it only works by dragging and dropping the file either onto the GUI or onto its dock's icon. As far as I know the app doesn't have any option to pass ...
1
vote
3answers
1k 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
86 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?
6
votes
2answers
2k 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
98 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
247 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
223 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
225 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
461 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?
2
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
333 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
710 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
209 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
277 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
805 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
133 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
315 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
338 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
340 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" )" ...
6
votes
1answer
1k 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 ...