0
votes
1answer
23 views

How can I stop the shell command `mate` from opening Textmate 1.x instead of Textmate2?

I've installed mate in the preferences pane in TextMate2. It says "Shell support installed." I added the string export EDITOR="/usr/local/bin/mate -w" to ~/.bashrc as instructed. However, when I use ...
1
vote
2answers
533 views

What is the Mac equivalent of Windows “start” command?

I'm creating a script that runs several other scripts. I need them to all start up in their own process (read window) so I can review the output of each, but I also need them to run in parallel, so ...
2
votes
1answer
36 views

Modifying .plist with shell changes .plist order

I wrote a simple shell command and saved it as .command. The shell command is simply: defaults write /Users/Milo/Desktop/MyPlist "My Key" "My Entry". The issue that I'm having is that after running ...
1
vote
1answer
55 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
2answers
114 views

Why Does a Shell Script Trapping SIGTERM Work When Run Manually, But Not When Run via launchd?

Okay, quite simply I have a shell script that needs to wait for something to happen, but it has a lock-file and some child-processes that I need to ensure are tidied up if the script is interrupted. ...
1
vote
1answer
47 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
1answer
118 views

Automator: Change to selected directory and run shell script

I'm trying to create a context menu command via Automator service. The context menu command will run a shell script to create some default documents in the given directory. I wrote out the shell ...
0
votes
1answer
28 views

How to script a logout while screen is locked?

I want to log out a user via a shell script, after a delay. However, there's a few other issues: User does not have admin and/or root. Logout must complete even if screen is locked. Currently, I'm ...
2
votes
4answers
369 views

Writing a shell script (or something similar) that will execute some commands

For my work I use an app called Sublime Text to edit website documents. To open my project in sublime text I drag the folder above the icon and it opens it up in sublime text. My next step is to run ...
2
votes
0answers
36 views

Why is Terminal.app corrupting my tcsh history?

I've had an ongoing problem that appears to be specific to OS X and Terminal.app: periodically, I get garbage in my tcsh history that looks like this: ^[[1m^[[4mcomputername:~/Code/emacs-source ( ...
8
votes
2answers
2k 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 ...
0
votes
0answers
24 views

How to get rid of remnant samba shares via the shell

I'm running 10.6.8, and under System Preferences > Sharing > File Sharing is checked, and I have no folders under the left side. Naturally the right-side isn't populated with any users. When I ...
0
votes
1answer
30 views

Where to Install Applications when using Terminal? [duplicate]

I use the command line a lot to download and install applications. I've always downloaded into the /tmp directory then installed to another directory. But where is the place to install such ...
1
vote
1answer
42 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 ...
-1
votes
1answer
28 views

Seeking shell-scripting resources for the visual learner

I'm trying to teach myself shell scripting. I understand things best when I see them in the context of a system, especially when I can visualize that system. I'm looking for a visual companion to ...
1
vote
0answers
36 views

Correct Way to Check if Spotlight Has Indexed a Folder's Contents

Okay, so I've written a script that uses mdfind to more quickly match files, however, I need to find the best way to check whether a target directory is indexed or not, so I can fall back to using ...
0
votes
0answers
25 views

Best Way to Add Metadata to a File

Okay, so I have a fairly simple script that uses mdfind to quickly find files matching certain criteria so that I can run some operations on them. However, I don't want to run these operations again ...
2
votes
1answer
360 views

How to remap tmux split pane keys?

On my linux machines, for my terminal shell I have tmux keys mapped to allow me to split windows and then switch between new panes. With or without these mappings I can't figure out how to remap the ...
3
votes
1answer
105 views

What is the relationship between `launchctl limit` and `ulimit`?

There is not any ulimit configuration in system startup files/ shell startup scripts. ulimit -a shows: -u: processes 1064 -n: file descriptors 256 launchctl ...
1
vote
2answers
110 views

Terminal.app equivalent of `xterm -e 'cmd'`

With xterm (and gnome-terminal, terminator, etc), you can run the following command: $ xterm -e 'vim somefile.txt' xterm will open and run the specified program (in this case, Vim). When the ...
8
votes
2answers
377 views

Shell Script for Yesterday's Date

I'm trying to execute the following shellscript with hazel app on any file in the folder. It works, but the only thing thats causing a problem is the date for yesterday. #! /bin/bash saveDir="TJ" ...
1
vote
2answers
148 views

What options does Terminal pass to bash on startup?

In the Terminal preferences, I'm able to configure the Terminal to "Open shells with:" -> "Command (complete path):" /opt/local/bin/bash. What options is the terminal passing when invoking this ...
0
votes
2answers
186 views

what shell would you recommend using on mac? [closed]

I'm new to Mac (using Mavericks) i thought to install zsh. Do anyone has a recommendation for a useful shell for mac?
0
votes
0answers
11 views

Command Line Tips and Tricks [duplicate]

==>> What are the most useful Unix shell "one-liners" that you use? <<== Here are a couple of mine to get the conversation started: 1. Repeat the previous command with a substring replacement: ...
0
votes
1answer
160 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
1answer
32 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: ` ...
0
votes
1answer
307 views

Can't exec “glibtoolize”: No such file or directory

I have a shell script autogen.sh , I run it under my project directory in terminal: ./autogen.sh I get error: Can't exec "glibtoolize": No such file or directory at ...
2
votes
1answer
870 views

Trouble in Automator's Shell Script after OS X 10.9 Mavericks upgrade

I've got a problem. I use from lot of time an Automator's shell script: cat >> ~/Dropbox/ClipBoard/Appunti\ Mac\ del\ $(date +\%Y-\%m-\%d).txt It ever worked but, after Mavericks upgrade, ...
1
vote
2answers
642 views

Symbolic links, why doesn't this work:

me$ ln -s ~/x/y/ ~/Desktop/ ln: /Users/me/Desktop//: File exists Why does this attempt at creating a symbolic link to ~/x/yon the Desktop now work? The only way I can seem to get something like a ...
1
vote
0answers
136 views

Where does Transmission store logs for called scripts?

Transmission has an option to run a shell script when a file finishes downloading. I'm wondering where to look for logs for it – it seems like it only executes half of my script but can't figure out ...
2
votes
1answer
68 views

Search files across folders and move recursively to new folder

I need a way to search from a base folder, all the folders inside of that one recursively, and find all photos of JPG and PNG that were created before a certain date (01.Feb.2013) and then move them ...
6
votes
2answers
3k 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} ...
4
votes
2answers
247 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
291 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 ...
0
votes
2answers
2k views

line 1: syntax error near unexpected token `newline' with HTML + shell script

I've been learning the shell with a great tutorial, linuxcommand.org. After a lot of learning and practice with navigating directories, editing files, etc, I've moved on to writing shell scripts. One ...
9
votes
1answer
221 views

Is it possible to set the output language of shell commands to anything other than English?

Am I correct in my assumption that shell commands such as cp, man, ls, etc. always print their messages in English regardless of system and user settings, and also standard shell messages like ...
0
votes
0answers
138 views

how to activate yadr after installing `ho my zsh`?

I have installed yadr and then ho my zsh how do i revert and activate yadr ? I have googled and found only how to uninstall ho my zsh: ...
2
votes
1answer
129 views

How can I systemwide check if a keyboard shortcut is in use or has been registered?

How can I query OS X to know if an application has registered a shortcut? I could inspect every app I have or that is running at least with KeyCue and go through the Keyboard Shortcuts section of ...
1
vote
1answer
232 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 ...
3
votes
2answers
343 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
3answers
164 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?
3
votes
1answer
105 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
99 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
73 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 ...
4
votes
2answers
3k 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 ...
5
votes
2answers
2k 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
168 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
506 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 ...
1
vote
1answer
133 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
251 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 ...