Tagged Questions
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
41 views
Is there a package management system for shell scripts on Mac OS?
Is there a package system (think npm, cpan, or even homebrew) that would be suitable for shell scripts?
1
vote
0answers
66 views
mac asking password after cd in terminal
Recently my mac has started asking me for a password after I use cd in Terminal.app (haven't tested other term apps).
strangely though, if I press ctrl-C when the passowrd is asked, the question goes ...
0
votes
1answer
54 views
Determine geolocation in shell / Terminal on OS X 10.5
Is there a way to determine geolocation in shell / Terminal on OS X 10.5?
There's another question, Is there a way to access a Mac's geolocation from terminal? (Mountain Lion), but it seems to ...
0
votes
1answer
42 views
How to manually determine version control metadata for Finder?
I have a Scripts folder where I keep Automator actions, Applescripts, and shell scripts. Automator scripts are automatically assigned a version of 1.1.1 it seems. When I make revisions to any of these ...
3
votes
2answers
396 views
Editing System Preferences via Terminal
Am looking to edit system preferences settings via the command line but cannot for the life of me find the correct names of variables.
In Login Options under Users & Groups, I would like to be ...
4
votes
1answer
146 views
How to reset $PATH?
I was trying to add something to $PATH and it went totally wrong. I now can't run any commands such as ls. I've looked at this answer and used the following lines:
...
0
votes
1answer
131 views
TimeMachine restore issue
Times ago I did a "restore from time machine backup" in order to restore all my files on a new SSD I bought for my macbookpro (with OSX Lion), and all went fine.
Today I installed Mountain Lion on ...
1
vote
1answer
202 views
How do I make terminal sessions resume on Lion with iterm2 and tcshrc
My understanding is that with Lion my terminal windows should restore their state. However, this does not happen for me. I wonder if this is because I use tcsh instead of bash?
Is there something I ...
0
votes
0answers
333 views
$PATH is driving me nuts! [closed]
(this is a dupe from SuperUser - dunno if that's bad form, please delete if so)
OK, apologies if this is something dumb, but I'm running out of ideas.
Goal: prepend /usr/local/bin to $PATH ...
1
vote
1answer
96 views
logger vs syslog -s
What exactly is the difference between using logger and syslog -s? According to its manpage, logger provides interface to the system log module, but I can't really see the point given that syslog(1) ...
1
vote
1answer
149 views
How do you prevent CodeRunner from prefixing its console output with [00m[00m[00m[00m[00m?
There seems to be a connection between CodeRunner's console output and your actual terminal prompt script, that is, if such prompt code is sourced from e.g. ~/.bash_profile (which CodeRunner reads by ...
1
vote
1answer
104 views
Colorful make compilation output
When I used Ubuntu, I remember that the output of make/gcc/g++ had nice colors, which were particularly helpful when needing to quickly identify errors (they were red).
Is there a way to enable ...
4
votes
2answers
164 views
How can I have my shell always start in a certain directory that is not my home directory
I've tried putting
cd /Users/my_name/my_directory/structure
in both .bashrc and .bash_login but neither works, i.e. when I open a new terminal window I am in my home (/Users/my_name/) directory.
...
3
votes
2answers
1k views
What terminal commands are new or updated in Mountain Lion?
Where can I find a list of new or updated terminal commands or features for Mountain Lion?
Lacking any list, does anyone have a sugguestion on how to generate that list? (some combination of ls ...
27
votes
4answers
1k views
Is there a way to access a Mac's geolocation from terminal? (Mountain Lion)
(Note the Mountain Lion update at end of question)
Some GUI apps use OS X location services, but I want to retrieve a Mac's physical location from the command line. This could be useful for running ...
0
votes
0answers
193 views
Mac OS X Lion xterm service behaves differently between Automator and keyboard shortcut
I created the following "Run Shell Script" service in Automator under Mac OS X Lion 10.7.4:
export DISPLAY=:0
/usr/X11/bin/xterm -title "Kevin's Xterm" -sb -sl 500000 -geometry 150x25 &
and ...
29
votes
3answers
12k views
How can I trigger a Notification Center notification from an AppleScript or shell script?
I'd love to be able to take advantage of 10.8's Notification Center features in AppleScripts and shell scripts I write.
Is there a built-in command or a third-party library I can use from either an ...
2
votes
2answers
326 views
pbpaste, pbcopy using wrong pasteboard?
I'm converting a shell script which xclip and similar tools on Linux, to use pbpaste and pbcopy on Mac. The problem is the default pasteboard ('general' according to the man-page) for these tools is ...
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 ...
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 ...
3
votes
1answer
541 views
-bash: Applications/mvim: /bin/sh: bad interpreter: Operation not permitted
I am getting a weird error with the mvim script that is supposed to start the MacVim interface.
See below for the issue. /bin/sh is just fine, mvim was chmod +x'd, other /bin/sh scripts run fine... ...
12
votes
2answers
6k views
Amending PATH so that /usr/local/bin is ahead of /usr/bin
I'm trying to install brew but get the following warning:
Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. ...
0
votes
5answers
2k views
How do I fix Terminal.app when my shell has been set to an illegal value?
Today I was mucking about trying to uninstall macports when I noticed an error being thrown up whenever I used sudo. I killed Terminal and tried to restart it which failed with the error message ...
1
vote
1answer
330 views
Bash problem Mac OS Terminal
Hi when I pressed the up arrow to see the previous command, it rewrote the current command from half.
Example:
21 /usr/local/sphinx/etc > /usr/local/sphinx/bin/search --config ...
1
vote
2answers
477 views
What is your preferred way to start a (shell) script from the GUI?
I was wondering what ways there are to start a (shell) script from the GUI, e.g. double-clicking an icon in Finder or launching via Spotlight.
This is not about opening a terminal and "manually" ...
5
votes
2answers
1k views
How do I reset the scrollback in the terminal via a shell command?
When using Terminal.app, you can clear the screen by using the shell builtin clear or by pressing ^+L (Control-L).
However, all this does is push the current screen content back one screen height ...
4
votes
4answers
1k views
Creating a virtual serial port
I'm trying to create a pair of virtual serial ports on my mac. This is fairly easy to do with many shareware programs on a PC. I figured there would be some uber-powerful shell command to do this in ...
0
votes
1answer
46 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)
...
3
votes
1answer
518 views
Search through terminal history with up and down keys in OS X Lion
After I upgraded to OS X I am not able to use my ~/.inputrc bindings to search through the shell command history:
# these allow you to start typing a command and
# use the up/down arrow to auto ...
1
vote
2answers
315 views
find video codec from terminal
I'm writing some shell scripts that automatically convert some video files. Except I don't want to run the conversion on files that are already h264 encoded. Is there a way I can tell via a terminal ...
2
votes
5answers
3k views
How can I write a script to open multiple terminal tabs and execute code in them?
I want to be able to open the terminal application and have it either automatically run a script that opens several tabs and run an arbitrary set of commands in each. For example I would like one tab ...
1
vote
2answers
823 views
Change Account Password to Blank
I recently changed an account password by accident, and was wondering how to set it back to a blank password via the shell. I have root privileges. Please help :)
passwd USER doesn't accept blank ...
2
votes
3answers
1k 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 ...
2
votes
1answer
139 views
Porting Linux shell scripts
The command
shell$ ls . -R
works on Linux but not on OS X. This is because OS X command line options have to come before the arguments,and not just anywhere as in Linux.
In particular, this ...
1
vote
2answers
2k views
Reset your PATH variable
I stuffed up (basically wiped) my PATH variable.
Is there any way to reset it to the default?
I look at this link on superuser, but I find it very confusing. As far as I know I stuffed up my ...
3
votes
2answers
1k views
open new terminal tab in the same directory with the active tab
In GNOME Terminal of Ubuntu when you open a new tab the new shell will automatically start you in the current working directory of the active tab shell.
E.g. if in the active tab shell I am on ...
2
votes
3answers
639 views
Check if a process is running, if not execute it again in Terminal
Is there a way to periodically check if a process is running with (probably with Apple script, or some other shell script) and if not then to execute it in Terminal?
I have a PHP script that is needs ...
2
votes
1answer
632 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 ...
5
votes
1answer
5k 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. ...