The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

1
vote
2answers
903 views

Hidden login script

I have a bash shell script that runs on login. Even though I selected the "hide" checkbox in system preferences, iTerm still shows while running it. How do I completely hide it?
2
votes
2answers
154 views

How do I link/call an actual shell script saved within an Applescript app?

What's the correct syntax in the Applescript below to make this app run by double clicking on it rather than how it runs now by just running the Applescript in the AS script editor? The Shell script ...
2
votes
1answer
192 views

Trying to remove files listed in file with AppleScript with do shell script call

The following code is an example of what I'm using at the moment, but it keeps erroring out on me: do shell script "find /Applications -name 'Bingo.app' > /tmp/remove_files" with administrator ...
0
votes
1answer
586 views

In iTerm, why is a command shell's command not picking up things on my $PATH?

I've got a script in my ~/.bin directory that changes iTerm's background before starting an SSH session (as detailed here, script slightly modified from this version). If I start a regular login ...
0
votes
2answers
168 views

messed up .bash_profile while configuring PostgreSQL

I am quite new to Terminal use. While installing and activating a local PostgreSQL server on my MacBook Pro (OS 10.6.8) I definitely messed up my .bash_profile (probably by messing around with user / ...
1
vote
3answers
133 views

bash: Searching with ls

Is there a bash command that can be used as Spotlight or an option with ls that only prints files containing certain text? I want to be able to open Terminal and type something ls -SOMEOPTION filename ...
0
votes
1answer
89 views

install libsoup on macbook pro

I have a shell script from a open source project, when I run it in terminal, I get the following error: ./configure: line 17678: syntax error near unexpected token `soup,' ./configure: line 17678: ` ...
1
vote
1answer
188 views

What's the BSD equivalent of the linux date command for adding subtracting days/weeks/months from a given date?

I have a given date, such as 2013-10-31 and I need to accurately determine the next day (taking into account DST, leap years, leap minutes, timezones, etc). I also have now way of knowing if the date ...
0
votes
1answer
1k views

Trying to install CocoaPods using terminal getting command not found

Im trying to install CocoaPods using terminal. In their official website it is written: installing it is as easy as running the following commands in the terminal: $ [sudo] gem install cocoapods $ ...
3
votes
1answer
1k views

\Trace/BPT trap: 5 when using open from terminal

After upgrading to Maverick, I can't use the open command anymore from the terminal. Whenever I do, I get: $ open http://google.de Trace/BPT trap: 5 This is independent on the document chosen. $ ...
0
votes
1answer
155 views

SIPS: Only Resize if Image is 315x300?

I'm currently using sips --resampleHeightWidth 250 300 "S1" to resize new images in a folder but I think that it might be resizing images that were already resized.. Is there anyway to know this for ...
6
votes
5answers
18k views

OS X Mavericks bash_profile paths don't work

I need to create a new path in OS X Mavericks. To do so, I edited .bash_profile: export LC_ALL="en_US.UTF-8" export PGHOST=localhost export PATH=$PATH:/usr/local/heroku/bin export ...
0
votes
2answers
314 views

Cross-Platform alternative to expr length

When running some BASH scripts I had in my Linux box I noticed that expr length gives syntax error. Manual pages doesn't seems to include any information about the length operator. Is it missing in ...
1
vote
2answers
3k views

User input assigned to variable in AppleScript then passed to “do shell script” command

How do I grab input from the user in AppleScript and then pass the result of the variable to a do shell script command from within AppleScript itself? For example, the user would type the answer foo ...
2
votes
2answers
844 views

Mount .sparseimage from .bash_profile

I need to mount a .sparseimage from .bash_profile but I don't get how to do it. I tried: alias of22='hdiutil attach "Documents/OF.sparseimage" -mountpoint "$HOME/OpenFOAM" > /dev/null ; . ...
2
votes
4answers
1k views

osascript “set bounds of window” not working after Mavericks upgrade

I have a number of bash functions I run at the beginning of each day to start work. They all look pretty much like this: mind() { osascript -e 'tell app "Terminal" do script "ssh -A ...
1
vote
1answer
560 views

terminal starts with `no such file or directory` message

I removed Enthought Canopy from my Mac and now when I start terminal there's this warning message says -bash: /Users/myname/Library/Enthought/Canopy_64bit/User/bin/activate: No such file or ...
0
votes
1answer
256 views

Launch script after command finishes

I find myself running some long scripts/commands and I don't want to wait looking at it until it finishes. On the other hand, I would like to know right away when it ends. I know you can do the trick ...
1
vote
2answers
354 views

Shell or Applescript to delay shutdown?

We have a workstation that gets used sporadically, and I'm trying to setup a script that backs it up during shutdown. I created a LogoutHook in com.apple.loginwindow to a 1-line bash script, that ...
0
votes
3answers
465 views

Run applescript as a service

I have the following applescript bundled as .app (using Platypus) and starting on user logon (12.4 MB for each user) #!/usr/bin/osascript -- INICIO DAS FUNCOES EXTRAS set app_path to path to current ...
2
votes
1answer
414 views

Bash not running script at /opt/local/etc/bash_completion.d/

I wanted to have bash autocompletion for git commands, so I dropped a bash script file into /opt/local/etc/bash_completion.d/. When I open a new Terminal, the script file in ...
10
votes
2answers
9k views

Run AppleScript from bash script

If I wanted to run an AppleScript from within a bash script I could call a file with the list of commands that I require to execute. #!/bin/bash {some commands} osascript file.scpt {other commands} ...
5
votes
2answers
2k views

What does -HUP do when used with killall?

Sometimes when I'm running a killall command from Terminal, a co-worker would suggest or edit my scripts to show killall -HUP. What does the -HUP part do?
4
votes
2answers
436 views

Pipe output of grep to a variable

I need to be able to write whether the test for a grep is either TRUE or FALSE to a variable so I can use it later For the following, if I run defaults read com.apple.Finder | grep ...
4
votes
2answers
940 views

Bash Script that will start up second Terminal process?

I need a script that will be able to fire up a second Terminal instance and pass a command directly to that one whilst it continues it's own executions. It's to start up Python script that will host ...
0
votes
0answers
87 views

Bash Commands and Terminal problems [duplicate]

Hello I open my terminal window on Mac Os 10.6.8 as I am trying to update my ruby to 1.9.3 and the terminal gives me this response immediately as I open it: -bash: export: ...
2
votes
1answer
350 views

Homebrew: Easy way to add 'gnubin' to path for multiple packages?

I would like to use Homebrew to install GNU versions of several utilities, and use the GNU versions by default with their usual names. From the output of brew install gnu-tar and by reading How to ...
1
vote
1answer
235 views

More colors than ls -G in file extensions

In the output of ls -G, I can see some extensions get colors like symbolic links or .sh files. What if I also want .jpg, .xml, .wav or .log to have different colors too? Also, is there any way I can ...
0
votes
0answers
35 views

.bash_profile dont recognises commands even after some editings

Can someone tell me when I open a Terminal window if my .bash_profile is loaded (or readed). Each time now (dont know why) some cmds (ie: ls, man) are unknow. When I edit the file (I add : export ...
2
votes
2answers
514 views

How to recover from “chown -R $USER /usr/”?

I ran a 'chown' on everything under /usr to a non root user. Meant to run it for /usr/local/ Now I get the error below on opening terminal login(89809,0x7fff7bac5960) malloc: *** error for object ...
1
vote
0answers
11 views

Access the GPS from Terminal [duplicate]

Is it possible to find out the location of a computer similar to the "set time by location" feature via command line? I'm working on a little script that would update my network location settings ...
2
votes
2answers
337 views

How do I get Automator to process images using ImageMagick in a command script?

I'm making an Automator workflow that uses the shell script action to process a selection of images with the imagemagick composite command. Only I'm having issues getting it going. According to the ...
13
votes
2answers
6k views

Why do I need to put sh before running .sh files?

When I want to run .sh files in Terminal, I need to put sh in front of them. Is there any way to avoid this, and thus save typing?
1
vote
0answers
64 views

What's the /home directory for, or did I just accidentally create it?

I saw reference to a bash command, cd /home, in a multiple choice quiz about navigating within Terminal. I tried it, expecting -bash: cd: /home: No such file or directory, but to my surprise it took ...
7
votes
4answers
139 views

How to list installed versions of the same program

I have a program called PyMOL installed multiple times on my machine. One was installed by MacPorts, one was installed through the developers distribution channel and so on. One is in /opt/local/bin, ...
2
votes
1answer
226 views

How can I send the current working directory from bash to Terminal?

I set up a very nice custom bash prompt in .bash_profile, but I noticed that I've now lost the ability for new tabs to open in the same directory, and the ability to see the current working ...
0
votes
2answers
44 views

wacked a directory from the command line

I was copying a file to /usr/local/bin from the commandline on a Snow Leopard Server 10.6 ... anyhow i typed the following ... sudo cp ./le /usr/local/bin Ouch ... that missed last forward slash ...
2
votes
2answers
3k views

What Version of Bash comes with OSX 10.9 / Mavericks?

Trying to decide if I want to bother upgrading my bash shell to v4.x; if it comes with Mavericks, I probably won't, but I can't find much information on what versions of bash come with what versions ...
13
votes
3answers
28k views

Getting files, all at once, from a web page using curl

I would like to download the files, all at once, from the following page using curl: http://www.ime.usp.br/~coelho/mac0122-2013/ep2/esqueleto/ I tried curl ...
3
votes
1answer
140 views

Running an AS droplet from Terminal

I have an Applescript Droplet application that I need to run from terminal. I can use osascript or even just open to open the AS App, but that will run its on run handler, not the on open droplet ...
4
votes
2answers
2k views

Changing terminal color

I would like to know how to change the terminal color, so whenever I run ls it will return the name of: Directories in red Files in blue Executable files (those you do ./file) in light green How ...
3
votes
3answers
20k views

How to create ~/.bash_profile and ~/.profile

So, I don't have .bash_profile neither .profile in my home folder. How do I create them? After that, what should I do so every time I open the terminal these files get read?
1
vote
3answers
551 views

Make shortcuts to directories via terminal

My problem is: whenever I'm coding, I work inside folders that are inside other folders and it's a long way to type: cd /folder1/folder2/.../folderN I know it's possible to make a shortcut to the ...
10
votes
3answers
3k views

OS X - Create a personal bin directory (~/bin) and run scripts without specifying their full path

So, what I am trying to do is to create a personal bin directory at my home folder. I created the following folder: /Users/thi/bin I put my scripts in this folder, but if I type in the Terminal: ...
0
votes
1answer
3k views

Mac OS X Terminal: -bash: $: command not found

While trying to install pagekite on OS X Snow Leopard using the following command: $ pagekite.py --signup I got: -bash: $: command not found I am a noob with the terminal but after reading a bit ...
2
votes
1answer
480 views

Is there a systemwide .bash_profile file?

The order of directories in my path is messed up, and I'm trying to correct it. Some of the path seems to be coming in from somewhere other than my user bash config files (I'm using both .bashrc and ...
0
votes
1answer
2k views

Automator won't execute my bash shell script

I have a bash script that works like a thread. Now I'd like to turn it into a service with Automator. Input is set to Image Files in Automator and the shell script action is set to Pass input as ...
0
votes
3answers
269 views

Alternative to cp --parents in terminal

I was trying to use the --parents option with cp (to create the non-existing directories in the target path) in the terminal but that option does not seem to be working in MacOS. >cp --parents ...
0
votes
1answer
53 views

Terminal app no longer automatically recognizes functions in my ~/.profile any more

I made some function in my ~/.profile to automate things like SSH connections. They were working fine until recently. Now I need to "run" the ~/.profile by doing . .profile each time I open Terminal ...
4
votes
4answers
137 views

How do I copy the content of a whole disk on OSX 10.3

I would like to copy the contents of a whole disk into another folder on an external drive. it should preserve permissions and timestamps. on linux i use cp -a but on OSX it seems to be different