A type of user interface for a computer. This can be both command line or graphical user interfaces. More commonly, shell often relates to the command line interface.

learn more… | top users | synonyms

1
vote
1answer
78 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
354 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 ...
1
vote
1answer
44 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 ...
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 ...
3
votes
2answers
152 views

How to have locatedb created / updated automatically?

I ran locate blob.txt and I got: $ locate .bashrc WARNING: The locate database (/var/db/locate.database) does not exist. To create the database, run the following command: sudo launchctl load -w ...
2
votes
0answers
53 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 ( ...
9
votes
2answers
10k 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
44 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
50 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 ...
2
votes
3answers
139 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 ...
2
votes
2answers
1k views

How do I change shells (bash to ksh) on OS 10.9.1?

I need to brush up on ksh after an 8 year hiatus. How can I run korn shell in my OS 10.9.1 terminal then switch back to bash when done with tutorials.
1
vote
1answer
70 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
36 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
62 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
34 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
1k 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 ...
0
votes
2answers
2k views

Set the master password from terminal

I am trying to set a master password from the terminal (using a shell script). I see the passwd function and the master.passwd function, however I don't see any documentation on either of these to set ...
3
votes
1answer
117 views

Apps using significant energy terminal/applescript

Does anyone know how to access the "Energy Impact" data used to determine "Apps Using Significant Energy" displayed in the battery menu bar? I'd like to use it in a shell-script/applescript.
0
votes
1answer
132 views

How can I launch .sh scripts from the finder in iTerm2 instead of Terminal?

I have set 'always open with' to : 'Iterm2', for .sh files in osX. Although a double click on a shell script now opens a new Iterm window, the script does not actually run, I just the get the empty ...
4
votes
1answer
135 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
226 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
620 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" ...
2
votes
5answers
484 views

Set Services keyboard shortcut via script OSX

I need a way to set the following programmatically: Specifically for shortcuts under Services, if that makes a difference. I'm wondering if this is possible via shell or AppleScript? EDIT: I've ...
1
vote
2answers
232 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 ...
1
vote
2answers
443 views

Single-user mode, data recovery, mount usb

I have a crashed hard drive. I had no luck with a USB to SATA using MacDrive Pro. I can get the drive to drop into shell with single user mode when I boot the drive. Can I mount a USB drive or ...
0
votes
2answers
525 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?
2
votes
2answers
131 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 ...
0
votes
0answers
13 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
390 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 ...
2
votes
2answers
114 views

Accessing a terminal when an interactive desktop session is unresponsive?

On linux distributions one can simply press the following keys in order to access the shell: Ctrl+Alt+F2 Ctrl+Alt+F7 to exit and return to the GUI. Is there a similar capability in OS X that would ...
1
vote
1answer
192 views

Unable to create a working .app executable using Platypus

I'm new to OS X and I'm trying to create an application wrapper for a shell script that starts a media server(Red5) I'm trying to wrap the Red5 server starter script (red5.sh) into an .app executable ...
0
votes
1answer
58 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
576 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 ...
1
vote
1answer
129 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 ...
2
votes
1answer
931 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, ...
0
votes
1answer
114 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 ...
1
vote
2answers
747 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
2answers
2k 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 ...
0
votes
3answers
279 views

Batch-processing Image Files in a Folder using a folder action with Automator

I'm trying to resize new image files in a folder using a folder action so the files that were already resized to 300x250 don't get resized again. The thing is I'm having issues getting the resizing ...
1
vote
0answers
224 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 ...
0
votes
1answer
202 views

Which background processes can I disable to speed up my Mac

If I'm on an old Mac and I just want the basics (web browsing, text editing, multitasking) to run a lot faster and I don't mind losing out on bells and whistles or temporarily disabling unneeded ...
0
votes
0answers
17 views

Yet Another Dialog for OSX [duplicate]

I have made a bash script on my Linux machine. In that script I use the command YAD (Yet Another Dialog) to display things or ask for input. I would like to use that script on my MAC and my question ...
0
votes
1answer
90 views

How Can I Set XCode to Correctly Highlight Multi-Line Strings for Shell Scripts?

Quite simply I have a shell script that I'm editing in XCode, and it contains several strings which contain new-lines. Easiest way for me to do this was just to leave the string open so that it spans ...
0
votes
1answer
217 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 ...
2
votes
1answer
102 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 ...
8
votes
2answers
6k 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
1k 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
356 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
4k 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 ...