1
vote
0answers
14 views

How to prevent TextEdit from commandline to cause Developer Unknown warning?

Is there any way (other than disabling Gatekeeper through preferences) to allow TextEdit to open my shell-script from a command-line? I'm more than ok with a dialog warning me, but the current dialog ...
0
votes
1answer
46 views

Terminal malfunction when running some executables

Short version I overwrote /bin/sh with something else and now I am having issues with terminal. How/can I restore/reinstall /bin/sh? Long version I think I did something silly. I was searching help ...
0
votes
0answers
11 views

Terminal: Different Profiles, Different Startup Command

In Terminal preferences you can create different "profiles" under the "Settings" tab. After selecting a profile, clicking the "shell" tab will allow you to set a startup command. However, this is not ...
1
vote
2answers
110 views

Shell variable PROMPT_COMMAND not working as intended?

I want my bash prompt to change depending on external conditions. Here is excerpt from the bash manual: PROMPT_COMMAND: If set, the value is executed as a command prior to issuing each primary ...
2
votes
1answer
61 views

Shell scripting: Why does only the “-” hyphen throw an error?

Goal: Cleaning up Selectively truncate filenames in my nvALT notes folder. I tried using a productivity blogger's suggestion (which eludes me after a thorough search) to prepend ^ > - + to ...
1
vote
1answer
16 views

How to change default LC_TYPE?

My OS X (Mavericks) seems to be setting LC_CTYPE environmental variable to UTF-8 by default. How can I change the default? I need LC_CTYPE to be en_US.UTF-8. There's a catch: I don't want to ...
1
vote
1answer
67 views

ffmpeg working from command line in Terminal but not in an Automator shell script!

I have just compiled my own copy of ffmpeg on my system and it's located in the following path: /opt/local/bin/ffmpeg When I run the following command in Terminal.app, it runs smooth: ffmpeg -i ...
2
votes
4answers
271 views

How to open a new Terminal tab in current working directory?

I want to create and run a bash function that: cd into a project's directory Open a new tab in Terminal in the same directory Open my dev tools and start dev services Item #2 doesn't work as ...
0
votes
1answer
47 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
653 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
62 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
255 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
235 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
72 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
280 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
39 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
1k 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
47 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
7k 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
40 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
39 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
59 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
35 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
53 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
32 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 ...
3
votes
1answer
851 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
119 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 ...
2
votes
2answers
184 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
537 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
212 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
354 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
12 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
293 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
47 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
482 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
903 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
713 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
201 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
91 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
5k 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
717 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
340 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
3k 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
241 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
169 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
180 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
260 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
397 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
183 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
108 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 ...