The default Unix shell used by Terminal in Mac OS X
6
votes
2answers
254 views
How can I change my default bash shell to a different one - /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 ...
10
votes
2answers
418 views
cd to a directory just by typing its name?
For example if a directory 'blob' exists, I just type 'blob[return]' and 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 ...
16
votes
2answers
6k views
How can git auto-complete branches at the terminal 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
1answer
228 views
Allow the Terminal.app to pass command key based keystrokes to terminal programs
I want to allow programs running in the terminal the ability to interpret the keyboard short cut Cmd + S
I have already Remapped the Terminals' default binding of Cmd + S to Ctrl + S via the ...
18
votes
3answers
4k views
Is it safe to upgrade Bash via Homebrew?
I'm new to OS X. I'm running OS X Lion on a MacBook Pro. Is it safe to upgrade the bash shell using Homebrew:
$ brew install bash
If safe, how do I make it the default instance of the shell I run ...
1
vote
4answers
607 views
Executables in /bin and /usr/bin are not found in path
Somehow I can’t execute files in /bin or /usr/bin without providing the full path.
This isn’t happening when running from Terminal, but, for example, iTerm can’t run bash (only /bin/bash), OnyX ...
0
votes
1answer
51 views
Cleaning up my .bash_profile: Can I delete some of this?
I'm not a Unix guru.
I'm running OS X 10.8.3 Mountain Lion. Today I removed Macports from my machine. I believe macports left some cruft in my `~/.bash_profile which I would like to remove (the ...
1
vote
3answers
49 views
Change file association in terminal?
Is there a method for associating file types with applications via terminal? I thought ~/Library/Preferences/com.apple.launchservices.plist might do it, and I also have seen: Why is a command line ...
1
vote
1answer
24 views
How to remove an environment variable on Snow Leopard
I'm running under Snow Leopard 10.6.8 and I recently added an environment variable which it seems to be messing my bash terminal (I guess).
What I did is add the variable ...
0
votes
0answers
24 views
Making checks before rsyncing external drive on OSX
I have the following issue on OSX though I guess this could equally be filed under bash. I have several encrypted portable drives that I use to sync an offsite data store or as an on-the-go data store ...
0
votes
1answer
32 views
How do I make a bash script so that I can drag its input on top of the icon?
I need to make a bash script to that I can drag a .rar file on top of it and then the script will receive the pathname of that file as argument 1 ($1). I have made the bash script, but how do I make ...
0
votes
2answers
47 views
Compress files with the output name same as Parent Folder with Automator
I've been searching the internet for a solution to this. I would like to create an Automator workflow that will zip the selected files, name the zip the name of the Parent directory and save that zip ...
1
vote
0answers
27 views
Terminal configuration lost after booting up
On OS X 10.8.3, my Terminal.app is configured with my .bashrc file. In my .bash_profile I have:
source .bashrc
It works great, except when I let some Terminal windows opened and shut down the Mac. ...
0
votes
1answer
24 views
Why does shasum generate non-standard hashes?
As far as I can tell, the shasum that ships with os x doesn't generate the hashes that it's supposed to.
$ echo "" | /usr/bin/shasum
adc83b19e793491b1c6ea0fd8b46cd9f32e592fc ?-
When I look up empty ...
3
votes
1answer
264 views
How do I find where an environmental variable got set?
I installed a program to try it out, and decided I didn't like it so I moved the app to the trash.
Today, in my shell, I noticed that there are a couple of PROGRAMNAME_BLAHBLAH environmental ...
1
vote
1answer
79 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 ...
3
votes
2answers
164 views
Are Bash, Bourne, and Korn shells compiled into one binary in OSX?
On OSX 10.8, if you compare the binaries for bash, sh, and ksh, a few different shell options, they are the same size. If you take it further and cmp the binaries, there seems to be only a ...
0
votes
1answer
31 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
57 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
2answers
706 views
Creating wrapper script for Mail.app to send mail from Terminal
I'm trying to send mail from terminal with the help of bash and applescript. I use bash for taking care of arguments and the email message body. Then I have tried using Applescript to send the mail ...
1
vote
3answers
402 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 ...
1
vote
1answer
35 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 ...
0
votes
1answer
30 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 ...
2
votes
1answer
30 views
Bad escaping in my bash 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 ...
5
votes
3answers
641 views
Updating modifier key mappings through defaults command tool
I am trying to automate the inital setup of my macbook, that includes installing software and changing OS X configuration to my needs.
I have tried to update the modifier keys with defaults, the ...
0
votes
3answers
360 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" ...
1
vote
3answers
139 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 ...
7
votes
5answers
250 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 ...
5
votes
2answers
294 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.
...
8
votes
9answers
3k views
How to get a notification when my commands are done
I'm running a series of commands on the command line that takes approximately twenty minutes to complete. I'd like to see some sort of notification on my Mac when these are finished so I don't need ...
2
votes
1answer
67 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 ...
1
vote
0answers
36 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 ...
7
votes
1answer
599 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 ...
1
vote
1answer
52 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
17 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
90 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 ...
2
votes
1answer
95 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
153 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
136 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
0answers
68 views
Can I start a named VPN connection from a shell script?
I'd like to start a VPN connection from a bash script. I've managed to figure out mostly how to do this with the pppd executable, but that won't work for my purposes. This VPN shows up in the network ...
5
votes
2answers
218 views
Strange behavior in Terminal with custom .bash_profile
It's hard to describe the behavior, but here's a short clip:
http://www.youtube.com/watch?v=9KqHBA94FPI
Basically, when entering multi-line commands, at the end of the first line, the insertion ...
0
votes
1answer
121 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 ...
0
votes
1answer
31 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
1answer
31 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?
4
votes
1answer
146 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 ...
3
votes
0answers
40 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 ...
4
votes
3answers
421 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) ?
...
18
votes
2answers
5k views
Is bash in OSX case-insensitive?
Are bash commands on OSX case insensitive? I type "which TR" and it shows /usr/bin/TR, though there is no such binary there. Same thing for other binaries, when capitalized. Or is Terminal.app maybe ...
1
vote
0answers
34 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?
...
2
votes
2answers
216 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 ...