The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

0
votes
2answers
363 views

How Can I Send Text (and Not a Text File) to My Printer on OS X?

I know about this question (How do I send ASCII text to printer (over USB)?). But I'm working on something different. I'd like to be able to send text from within a bash script or Perl script to my ...
0
votes
1answer
115 views

changed user path and lost aliases in .bash_profile

I reinstalled mountain lion recently and had to reset my git path. Everything was working fine until I realised I had to do it for every project so I tried to change the default system path by sudo ...
1
vote
1answer
473 views

Automator to execute shell script with an input text file, copy it to specific directory

I'm simplifying making a .deb file with Automator. I currently have a shell script that does some simple actions - Ask the user for text input Do some directory parsing Execute a command with the ...
2
votes
2answers
1k views

My Automator Workflow fails because it fails to find the git command within the 'Run Shell Script' command? Need help

I have an Automator workflow and one of the actions is to clone a repository. Here's the code for the 'Run Shell Script' action. The command is run within the Bash shell /bin/bash if that matters: ...
3
votes
2answers
189 views

Re-reading your .bash_profile

When you make a change to your .bash_profile it will be read the next time you open a terminal. But what if you have a terminal open already. Is there anyway to do a re-read?
0
votes
1answer
177 views

How can I make OS X's bash expand $PWD to be case sensitive?

I am running OS X 10.8 on a MBP 2011. I use some bash-scripts for tasks like backups of remote servers. One of the scripts contains this snippet: #!/bin/bash if [ "$PWD" != ...
0
votes
0answers
34 views

Why nc doesn't response even if the “w” option set?

For some servers: nc -w 1 -z x.x.x.x 22 doesn't work. It has no response, but is looking like very busy: only ctrl + C can help. So -w 1 seems to be a useless option, to specify the timeout. Does ...
0
votes
2answers
541 views

vi shortcuts on bash on mac not working e.g. CTRL + E, CTRL + A [duplicate]

I have used vi as my main text editor for years now on Linux (and a few years back Mac too) and on my brand new Mac (running 10.8.4) I find when trying to edit a file using vi in Terminal I can not ...
1
vote
1answer
1k views

Playing alert sounds from terminal

Is there a way to play OSX alert sounds from terminal? The alert sounds that are listed in System Preferences > Sound > Sound Effect Tab
0
votes
0answers
14 views

How do I use Mathias .osx defaults? [duplicate]

I just got a mac and am still familiarizing myself with it. I was taking a look at: https://github.com/mathiasbynens/dotfiles/blob/master/.osx Not sure how to use it!
2
votes
1answer
1k views

Meaning of “./” in Mac terminal

I am a new user of the Mac terminal. What is the meaning of "./"? What is the difference between the commands rm image.png rm ./image.png rm *./image.png
0
votes
1answer
1k views

Changing the command prompt of Terminal

I have found myself to grow fond to CentOS's command prompt which looks like the following: [user@host directory]$ cmd I, personally, do not like how Mac OS X Terminal is laid out, which is: ...
0
votes
1answer
253 views

How to auto run a simple python program when the terminal opens

Say I have a python program called foo.py that prints a line of text. How can I auto run that program when I boot up the terminal? I know you can, but I can't find the documentation. Also no third ...
3
votes
2answers
2k views

How do cope with a space when setting the $PATH

I want to add the sublime lib to my path but it has a space in it. I have tried the obvious like you would navigate in the terminal E.g /Applications/Sublime\ Text\ 2.app/Contents export ...
1
vote
1answer
2k views

Terminal bash commands stopped working

I was trying to install some stuff for scala development on my MAC, and probably I managed broke the shell/terminal while I was mindlessly running some scripts that I don't know. Now when I start the ...
2
votes
1answer
110 views

extract to a new folder with spl name

working on OS X 10.8.3, have part of what I want working, hoping for help with the rest #!/bin/bash # script accepts a path to base dir - base path to extract # also accepts second param - archive ...
4
votes
2answers
3k views

How to strip a filename of special characters?

I have a file with a name such as "Today's Date.txt" What I am interested in is stripping away all special characters using the terminal such as: " - , ' ' [ The reason for this is because I ...
0
votes
2answers
348 views

Reinstall bash on MacOS 10.7

I have a MacBook Air where someone attempted to install this version of bash over MacOS's native one unknowingly. I attempted to fix this by removing the files created by the installer (the readme was ...
4
votes
1answer
928 views

Can't run vi from terminal

Every time I execute these commands: vi or vim in the terminal, it gives me the following error: -bash: /usr/local/bin/vi: No such file or directory or -bash: /usr/local/bin/vim: No such ...
2
votes
1answer
164 views

OSX equivalent for ~/bin in Linux

When using Ubuntu I can save shell scripts in ~/bin. To launch them I just type the name of the script in the Terminal. Is there an equivalent solution for OSX?
2
votes
1answer
576 views

OS X Mountain Lion Terminal and tabs take ages to load

When I open a new Terminal tab I have to wait at least 10-20 seconds before I can work with it, I have followed previous suggestions here: How do I speed up new Terminal tab loading time? But so far ...
0
votes
2answers
3k views

How do I run VLC with command-line parameters when clicking the icon?

I've tried changing the Info.plist to point towards a bash script which runs the executable with the parameters that I want. This doesn't seem to work even though when I invoke it from Terminal.app ...
0
votes
1answer
2k 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 ...
3
votes
3answers
4k 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
4k 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 ...
2
votes
1answer
740 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
868 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 ...
0
votes
1answer
229 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 ...
6
votes
2answers
1k 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
50 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 ...
2
votes
2answers
1k 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
85 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 ...
5
votes
1answer
3k 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
187 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
381 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
626 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 ...
2
votes
3answers
2k 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
2answers
721 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
281 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
325 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
39 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 ...
3
votes
1answer
309 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
585 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
362 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
745 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
1k 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
698 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
52 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
129 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
46 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: ...