The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

4
votes
1answer
812 views

Accented characters and terminal redirection

I'm having problems dealing with accented characters in file names in the Terminal. Consider the following: $ touch leão.png $ ls > test.txt $ open -a TextWrangler test.txt The accented ...
2
votes
2answers
4k views

How can I exit “bash”?

I don't know how to get my .profile aliases back in to the terminal every time I try them, this error massage comes up: apaw:~ apaw$ cdp -bash: cdp: command not found How do i exit this -bash? I ...
3
votes
2answers
246 views

what is DELUXE-USR-LOCAL-BIN-INSERT in ~/.profile file?

My .profile file includes the following obscure lines. What are they for? ## # DELUXE-USR-LOCAL-BIN-INSERT # (do not remove this comment) ##
0
votes
2answers
3k views

How do I use arguments together with bash aliases

Today, I learned the very handy trick: man [some command] -t | open -f -a Preview I'd like to create an alias in my .bash_profile file as a shortcut. In order for this to work, I need to pass an ...
1
vote
2answers
514 views

What changes have been made to bash in Lion?

I am working on some bash shell scripting for a local login script and it works fine on Leopard and Snow Leopard but fails on Lion. I was curious if there was a place that listed the differences in ...
0
votes
1answer
55 views

Customizing the shell prompt causes some quirks

I have customized the shell prompt with the following code in my ~/.bash_profile, but there is one quirk left I can't seem to fix: export PS1="\u:\[\e[32;1;32m\W\e[m\] \$ " (code is also on github) ...
4
votes
3answers
492 views

In terminal, modify the text that comes before $

In terminal I can always see which path I'm in: macbook-romeo:School romeovs$ echo "example command" which I find quite useful. Yet there is a lot of unnecessary stuff here too: macbook-romeo is ...
2
votes
1answer
880 views

Run bash command with current URL as parameter from Firefox and/or safari

I'd like to be able, without much hassle, add a video to my Miro Download-queue. From bash I can do this by entering open -a Miro.app http://vimeo.com/24398084 Now I'd like to do this from within ...
1
vote
1answer
357 views

Correct syntax for bash grep function?

I'm trying to set up a function to make certain grep command easier. gr() { grep -r --include=*.\{m,h,xib\} $1 \* ; } The end result should be a recursive grep of all *.m, *.h, and *.xib files, for ...
5
votes
5answers
5k views

How do I restore my .bash_profile?

I've accidentally overwritten my ~/.bash_profile file. Does anyone have a "sample" one I could copy, or know where I might be able to find one?
3
votes
2answers
2k views

How do I make invisible files (like bash profile) visible in the finder?

question is in the title. There's some files that most Apple users don't need access to, but if you program you do need access to. in particular the bash profile. anyone know how to make these visible ...
47
votes
3answers
13k 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
3answers
1k views

-Bash command not found appearing every time I start terminal

every time I start my terminal, it always says "-bash: .: command not found" twice. Does anyone know how I can get rid of that?
6
votes
2answers
3k views

What option should I give the sudo command to have the password asked through a graphical interface?

This problem has ben bugging me for a while now. Every now and then, I need to write a script file that should execute sudo commands. I do not necessarily know in advance that I will run as sudo so I ...
2
votes
2answers
1k 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. ...
2
votes
1answer
405 views

Always show service in contextual menu

Sometimes when I create a service in Automator, I want it to always appear in the Finder contextual menu, not just when I have a selected a file or folder. The services are always either pure ...
33
votes
3answers
13k 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 ...
3
votes
5answers
4k views

Why do I have to source ~/.bash_login every time I open Terminal

When ever I close and open Terminal.app, it never loads my ~/.bash_profile. I have my RVM setup at the top of the file but it never loads it. As you can see, when I type rvm into Terminal, it says ...
1
vote
2answers
247 views

show battery in prompt and have it update after every command

i just fresh-installed Lion, and i am in the process of seeing up my system. i am using this function (found somewhere online...) to show it in the prompt : battery_status() { maxcap=`ioreg -l | ...
2
votes
1answer
351 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 ...
7
votes
2answers
2k views

Changing Terminal colors when ssh-ing into remote machine and back

Looking for a way automatically change terminal colors when ssh-ing into remote machine and revert back to the default colors, when exiting the ssh session. Simply, want have another colors when i'm ...
2
votes
1answer
430 views

Mac Terminal: emacs-style command editing messed up

This has been a "quality of life" issue for me for a while now- command-line editing in the Mac terminal is messed up for me. If I type a few chars, and then hit CTRL-A to move to the beginning of ...
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
4answers
5k views

Find logged on user and network home directory with a bash script

I am trying to use a script to find the username and home directory of the user that is currently logged on to a Mac. This is what I have, and it works, but is there a better (i.e. simpler) way to do ...
1
vote
2answers
367 views

Rsync Backup Script

I'm having some issues backing up some data. Basically, I have FileVault enabled on my Macbook Pro and want to backup a folder I use - however, I don't want to use Time Machine (at work, I have one ...
1
vote
3answers
134 views

Is there a way to turn on indicator that a directory item is a shell script in Terminal?

When I do an ls of a directory and a shell script is listed as a directory item, is there a way I can have a visual indication that it is a shell script ? For example: From /opt/local/bin ls -l ...
3
votes
3answers
5k views

Where are environment variables specified when .profile, .bash_login, .bash_profile cannot be found?

When I type env at the terminal prompt, I get a dump of all the environment variables. When I check / or ~, however, I do not see a .profile, .bash_login or .bash_profile. Where is this being stored ...
10
votes
4answers
2k 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 ...
5
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 ...
45
votes
9answers
83k views

Why doesn't .bashrc run automatically?

I put some alias commands in my .bashrc file, so that they might be loaded everytime I open a new Terminal window. Yet this doesn't happen. I have to select run script: in the ...
4
votes
3answers
9k views

Netcat -e on Mac OS X

I'm a newbie macuser coming from Debian, and I'm a big command line user. One one my preferred one is netcat (aka nc on mac). I especially loved the -e option which enabled to create a process that ...
5
votes
1answer
3k views

How can I reset my bash configuration?

When I open Terminal it shows this: Last login: Fri Apr 1 17:04:59 on ttys000 -bash: export: /opt/local/bin': not a valid identifier -bash: ...
12
votes
2answers
5k views

How to enter special characters so that Bash/Terminal understands them?

Let's say a folder has a file called Näyttökuva.png (for those who are interested, it is ”screenshot” in Finnish). This is what happens: $ ls Näyttökuva.png $ ls N* Näyttökuva.png $ ls Nä* ls: Nä*: ...
2
votes
1answer
992 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 ...
17
votes
10answers
12k 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 ...
7
votes
3answers
8k views

Change Terminal.app's Default Shell to BASH

How can I change Terminal.app's default shell to BASH? For some reason, my friend's Mac (10.6.6) defaults to using TCSH instead of BASH. The obvious remedy is to choose /bin/bash as the command to ...
9
votes
1answer
12k 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. ...
1
vote
1answer
1k views

Mac OS X Terminal [Use option as meta key] overrides backslash in spanish keyboard

I already posted this question in stackoverflow: http://stackoverflow.com/questions/4811282/mac-os-x-terminal-use-option-as-meta-key-overrides-backslash-in-spanish-keyboar but I was informed there ...
13
votes
7answers
2k views

Is there a bash command to check to see if Time Machine has finished backing up?

I'm writing a script that will rsycnc my Time Machine directory to a remote server using ssh. I've switched from a shell script to an AppleScript and then back to an Apple script and I don't really ...
14
votes
4answers
17k views

How to get the fully resolved path of a symbolic link in Terminal?

I have a tangled mess of python installations on my laptop. I was looking at the executables in /usr/local/bin and they are all symbolic links to ../../../Library...... There's some weird behavior ...