The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

1
vote
2answers
149 views

OS X Terminal not recognizing any commands

I recently tried to install CoffeeScript on my mac and now am unable to use even the most basic of commands like ls, cd and so on. Something tells me that it's because the $PATH variable has changed. ...
1
vote
3answers
2k views

How do I undo “export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile”

I was trying to install homebrew, which wasn't working. It told me to do echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile. However this wasn't having any affect, and I thought maybe it ...
1
vote
1answer
116 views

How can I fix my $PATH variable?

I need to revert my $PATH back to the default. The catch here is that I broke it so bad that the echo $PATH command returns: /usr/ that's it, which means I can't use any of the methods described in ...
2
votes
3answers
157 views

Bash: Return the most recently edited file in a specified directory

For a bash script I am currently developing I want to access the name of the most recently edited file (including folders but not subdirectories) in a specified directory. How do I do this?
1
vote
1answer
121 views

Bash script to run command with prompt for input

How can I create a script using the following command? mmap -sn -n x.x.x.x/8, /16, /24 and so on. I would like the script to run the command when I type in "sweep" and then prompt me for the subnet ...
1
vote
1answer
156 views

Running shell commands with Automator: how to create a droplet launching an “exec” command?

I need to create a automator application that launches the following exec command, whenever a image file is dropped onto it (the exec print the image files with some printing params). exec('lpr -o ...
1
vote
1answer
76 views

Using MacPorts bash, tab completion no longer lists hidden / dot files

I used MacPorts to install bash (bash @4.3.8_0). I switched Terminal to use /opt/local/bin/bash as the command to startup. However, now when I type vim ~/.<tab><tab>, it no longer lists ...
0
votes
1answer
43 views

Full path to python as reported by ps

When I run python from the shell I for example do python2.7 script. I later need to find this command again based on the ps aux output, however this output shows a full absolute path like this: ...
2
votes
2answers
183 views

make it easier to call often used terminal commands

I have a java tool that I use quite often from the command line but to use it I have to type java -jar dsim.jar. I want to make it so that I can call it just by typing dsim regardless of what ...
1
vote
1answer
206 views

How do I get osascript to parse backslashes and run this command in a new Terminal window?

Here's a command that works fine when I paste it into the Mac Terminal window: echo -n -e \\033]0\;My Custom Window Title Here\\007 ; ping www.google.com In particular, it sets the Terminal's title ...
2
votes
1answer
1k views

iTerm colors for Prompt, Command, and Output

Right now my iTerm2 looks like this... Everything is the same color and is hard to read. Can I make any of the Prompt, Command, and Output different colors like this?
4
votes
1answer
222 views

Terminal not displaying colors for directory listings

I don't know why my bash session doesn't show colors. I have tried Terminal as well as iTerm. I have tried: ls -G Setting export CLICOLOR=1 and export LSCOLORS=GxFxCxDxBxegedabagaced Using ...
1
vote
1answer
173 views

File tree list Mac Terminal

I am trying to create a .txt file that is the output of a certain function in the terminal. So my function is to create a list of all the files that i have inside the folder TEST so what i typed was: ...
1
vote
1answer
725 views

command not found for shell script

I created the following bash script in OS X 10.7.5: $ cd ~/Documents/github/scripts $ vim hello_world.sh #!/bin/bash clear echo "The script starts now." echo "Hi, $USER!" echo "I will now fetch ...
0
votes
1answer
39 views

Run Emacs within Bash

I am looking for a way in Bash to run something within Emacs. For example, if you run emacs, press esc+X then type "life," you get a little simulation of Conway's Game of Life. How could this be done ...
1
vote
1answer
89 views

odd behavior of pgrep in bash script

I have a script to kill a process tree that works fine in linux but I am experiencing some odd behaviour on osx. It actually works fine with my unit tests and also when trying to run it manually on ...
0
votes
1answer
27 views

How can I update homebrew and upgrade the new packages in one step?

I often run brew update followed by brew upgrade. Can I do that in one step?
2
votes
2answers
58 views

History commands render incorrect on Bash Vi mode

I'm having this werid and really annoying issue in bash vi-mode. Env: Mac 10.9.2, iTerm 2 1.0 or Terminal.app, $TERM={screen-256color|xterm-256color|xterm|vt} Repro steps: Run some long commands ...
1
vote
1answer
132 views

ImageMagick. Multiple SVG files are only allowed for PDF and PS output

I'm running script /tools/generatepngall.sh from https://github.com/twain47/Open-SVG-Map-Icons to generate PNG icons from SVG-files. However, there are errors: Multiple SVG files are only allowed ...
1
vote
1answer
109 views

Why does my path not get saved even after editing ~/.bashrc? [duplicate]

I've added maven to my path, but it doesn't seem to be persisting to the path beyond the lifetime of the terminal application. I've modified my ~/.bashrc, but it still isn't storing the modified ...
1
vote
1answer
82 views

How to open shell scripts in editor when double clicking on them

I'm trying to migrate to OS X. One thing what I find really strange / dangerous that by double clicking on shell scripts, I launch them in Terminal. I would like to change this behaviour to open them ...
0
votes
0answers
27 views

Convert absolute symlinks to relative ones?

I've seen plenty of threads on the Internet about doing the opposite, but what I want to do is, given a folder: /Lib/Foo/Bar.framework/Versions/1.5 And a symlink to it: ...
0
votes
2answers
64 views

piping find to head

I have a script to read the first line of any text file with a certain extension within a certain folder, recursively, but it doesn't work. The head command is non-functional. #!/bin/bash while true; ...
1
vote
0answers
58 views

Detecting that an external display is plugged in or unplugged on a laptop via bash

Is there a way via bash to detect that an external display has been plugged in or unplugged via bash? I know that I can create a crontab command that fires a script that uses the system_profiler ...
1
vote
1answer
159 views

Vim like terminal

I recently discovered terminal's feature, you can set the keys emacs or vi style I prefer the second. so if you do set -o vi You can use k j l h keys to navigate on the command line. And you can ...
0
votes
1answer
75 views

What is the best way to migrate a .bash_profile to Mavericks

I have a pretty extensive .bash_profile set up on my older machine using Lion and I would like to include a lot of the same functionality. I noticed that Mavericks doesn't have a .bash_profile by ...
3
votes
1answer
275 views

How to restore my deleted .bash_profile?

I have deleted my .bash_profile with rm command and copied another one to use. But now i remember there is some PATH thing in the previous file :(. Can i find the deleted .bash_profile in some place ...
1
vote
1answer
78 views

How to share .bash_profile between different users in the same group? [duplicate]

I have searched by google but cannot find a right solution.The scenario is like this: in my mac, there are two users, lets say user1, user2. these two users are in the same group, which is staff ...
1
vote
1answer
77 views

Automator get first 3 letters of parent folder

How do i get the first 3 letters of the parent folder im creating a folder in with automator im designing a Automator service to create a project folder in the folder of a client and I want to append ...
0
votes
1answer
89 views

How is $PATH created?

I am still relatively new to the workings of the Mac OS but have extensive knowledge of Linux. I updated my php on Mavericks using the php_osx and the instructions stated to use export ...
2
votes
1answer
519 views

Forward slash doesn't work when in terminal… works in every other application

I'm trying to use terminal and in every tab I open, when I try to change directory such as cd / I get a beep and am unable to type the character. I am on the same computer and am able to ...
0
votes
1answer
18 views

Deleteing Original File After Creating Another

Here is the Script I have so far: #! /bin/bash dd=$(date -v -1d '+%Y-%m-%d') for file in *.csv ; do saveName="${dd} - TF.csv" cut -d',' -f5,8 "$file" > "$saveName" done The file ...
0
votes
1answer
191 views

Rsync exclude-from not working

I have created a rsync script which has been working fine until I made recent modifications adding exclude-from clause to it. When running the script it returns the following error: rsync error: ...
1
vote
1answer
336 views

Root crontab won't save

I'm trying to add a crontab entry to my root user's crontab. I'm able to add an entry without issue to my regular user's crontab, but when I su to root user and try adding a crontab entry it does not ...
0
votes
0answers
23 views

Automatically copy PDF.plugin to Chromium.app

I'm using Chromatic.app to update my Chromium.app recently. I'd like to use Chrome.app's PDF.plugin in Chromium.app. Therefore I need to copy PDF.plugin to the following directory: ...
2
votes
2answers
343 views

Does Mac OS X's bash read scripts for all users (tab-completion scripts) from /opt/local/etc/bash_completion.d path?

I stumbled upon some instructions in the book "Pro Git" It suggests: Download this file : https://github.com/git/git/blob/master/contrib/completion/git-completion.bash If you use the Bash ...
1
vote
0answers
159 views

What is multi user mode in MAC and how to boot in multi user mode in MAC Mavericks [closed]

What is multi user mode in MAC operatins system and how to boot in multi user mode in MAC Mavericks
9
votes
2answers
12k views

Why Mac OS X don't source ~/.bashrc [duplicate]

I found a lot of people figuring out why instruction similar to this : Put X to your ~/.bashrc and you can do Y don't work. It always turns out that Mac OS X's bash's startup files (or Mac's ...
2
votes
2answers
127 views

Can't open a file in sublime text using bash_rc

My bash_profile function looks like: function st() { /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /Users/ishan/workspace/nltk_engine/index.py;} However, when I do st in terminal, ...
0
votes
1answer
105 views

What is the proper way to use the cut command on ps command output

This question is related to a question I posted on rogue firefox procesess. It relates to firefox processes following image uploads that I have been having for a while. I am trying to get to the ...
2
votes
2answers
138 views

How do I change $PATH and set it to the default directory?

For some reason when I run echo $PATHI get the following directory: /Users/<home>/Library/Applications/. How do I set it back to its default location so that I don't have to run this command, ...
5
votes
1answer
9k views

Mac OS X Mavericks - add to path

I'm trying to set up a phonegap project and while trying to add a platform it outputs the following error: Error: The command "android" failed. Make sure you have the latest Android SDK installed, ...
2
votes
3answers
144 views

Behavior of login shell vs. Linux, 'sh -c'

I have a seemingly-valid command that works fine on Linux boxes but fails on OSX, and I would like to know why. sudo su - validusername sh -c 'whoami' On Linux, this will echo 'validusername' on ...
0
votes
1answer
962 views

TERMINAL ~/.profile does not contain source ~/.bashrc MAC OSX 10.9.1

terminal shows below on this stage on gerris installation page : http://gfs.sourceforge.net/wiki/index.php/Mac_OSX_Installation Note: make sure that the file ~/.profile contains the line source ...
1
vote
1answer
83 views

How to find out which terminal app (iTerm or Terminal) is running from within bash

I need to have different color schemes for each of the two terminal types I use. I can set it in the .bash_profile as mentioned here. But how can I tell it to differ depending whether its a iTerm2 or ...
3
votes
1answer
4k views

`LSOpenURLsWithRole() failed with error -1712 for the file </path/to/folder>` when I attempt `open .`

I suddenly came across this error when I attempted to do open . to open the current directory in Finder, a command that I use quite frequently: ysim:~/Downloads$ open . LSOpenURLsWithRole() failed ...
0
votes
1answer
217 views

In Terminal, when the the “cd” command is called, libwww-perl's “head” command is also executed

Currently, in Terminal, when I execute a cd command, it also executes LWP's head command. A copy of the Terminal output follows: laptop:bin user$ cd ~ Unknown option: n Usage: head [-options] ...
1
vote
2answers
96 views

Combine two bash find commands

I have two similar find commands that I basically have the same code for both once the while loop begins. I want to combine them so I only need one find to search through files and directories, ...
8
votes
2answers
217 views

Piping multiple commands

I would like to run the following command and pipe stout of both to TextEdit: pmset -g; echo; pmset -g assertions | open -f -a TextEdit This doesn't work, it only executes the latter: How?
1
vote
1answer
308 views

Remove special characters and replace space with _ from files and directories Recursively in Bash

I have a script that is giving me some problems, I know that I have to re-do it recursively but am having some trouble. The script should rename all files and folders in a given folder by removing ...