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
17 views

How can I inspect the environment variables of a running process?

Is there some equivalent (CLI or GUI) to Linux's /proc/$PID/environ feature?
0
votes
1answer
19 views

Creating a script that will execute a program and if it exits without crashing, will run it again

I've already asked this question in the UNIx exchange but I was told to ask here also about AppleScripts if the standard shell does not work. I require a script that will open an application. Wait ...
0
votes
1answer
29 views

How to iterate through multiple file extension without caring about case sensitivity?

I've seen various topics on how to iterate through multiple file extensions, but in most cases the list is defined. example: for file in ${arg}/**/*.{txt,h,py} do .... done As can be seen, ...
1
vote
2answers
29 views

How to run a script from Alfred or Spotlight or any run dialog?

Coming from Linux I am really missing the good old gmrun -- a run dialog which recognizes your $PATH and allows you to execute any script in it without needing to open up a terminal. It does the job ...
1
vote
1answer
63 views

Execute simple script

I wrote the following very simple script: route -n add 192.168.0.0/20 192.168.224.1 route -n delete 0.0.0.0 route -n add 0.0.0.0 172.20.10.1 And would like to just double click it and you ...
1
vote
2answers
46 views

Attempting to run find command gives “Permission denied”

I am attempting to obtain a list of applications on my Mac using find to search for *.app. However, when running the command, I get a lot of Permission denied messages, as below. The computer is mine ...
1
vote
1answer
67 views

How to put a application in fullscreen using shell command in Mavericks?

I would like to ensure a application is running in fullscreen using a shell command (or script). I've seen some approaches that tell the application to execute a keyboard shortcut (cmd+ctrl+f) but ...
1
vote
0answers
15 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
25 views

dpkg.pm @INC dpkg-scanpackages / > Packages

I am running Max OS X 10.9 Installed: -Xcode 5 (latest version) -Fink -MacPorts -Xcode Command Line Tools -Theos I have a shell script running Dpkg-scanpackages debs / > Packages But i am ...
0
votes
1answer
53 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 ...
3
votes
0answers
15 views

how to run alias using bash -c from IDEA

I'm trying to run a program defined in an alias (and the alias is defined in a source file) alias myapp="/somepath/app -arg1 -arg2" Then I go to IDEA and create an External Tool Program: Bash ...
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 ...
2
votes
1answer
86 views

Dollar sign in mdfind shell command

I'm a newbie in shell scripting. What's the difference between these two commands? What's the use of the dollar sign? mdfind $'kMDItemFSName="*iValet\'s*"c' mdfind 'kMDItemFSName="*iValet\'s*"c' ...
1
vote
2answers
116 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 ...
0
votes
2answers
41 views

chsh doesn't change $SHELL

I'm having some difficulties in changing the value of $SHELL in OSX's iTerm app. iTerm is starting in /bin/zsh, but the value of $SHELL doesn't seem to change. What I've done: Changed "command" as ...
2
votes
1answer
63 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 ...
3
votes
3answers
115 views

Shell scripting: Select folder based on part of file name

My project I'm creating a bash shell script to execute from the Terminal. Its purpose is to archive lots and lots of project folders. Each folder follows a prescribed nomenclature: [YYYY.MM.DD] - ...
2
votes
1answer
59 views

Shell script: Move folders + preserve structure

My goal I organize my projects into folders. These folders all live in my Completed projects folder. I am beginning to archive them into an Archived Projects folder, and I want to archive them in ...
1
vote
1answer
80 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
1answer
207 views

How does this complex BASH shell script work?

Apple Support Community member Linc Davis developed this command to aide in diagnosing issues. The output gives a general overview of one's system and is very similar to the program etrecheck. But, it ...
2
votes
4answers
298 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 ...
1
vote
1answer
43 views

How do I create a shortcut to IPython's interactive shell on the dock?

I have successfully installed IPython. I can open the interactive shell by typing this from the Terminal: ipython qtconsole & Is there a way to create a shortcut on the dock that executes the ...
2
votes
1answer
106 views

Trim filenames in automator w. shell or applescript

Why doesn't this work? (The automator is in swedish but the parts are: get selected finder objects - get folder contents - run shell script) I want to trim the first three characters of the ...
1
vote
1answer
82 views

Script to check Software Version

Hi i'm tryin to write a script to check software version. I want to pass my own variables, which are name of the Application and Version. Here's a copy. It's not working for me currently... i'm a ...
1
vote
1answer
60 views

skill -KILL -u $user Command on Max OS X?

Is there an alternative for the skill -KILL -u $user command on the Mac OSx. The basic requirement is I want to log out my current logged in user at end of shell script This program logs out Linux ...
0
votes
1answer
50 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
662 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
63 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
271 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
240 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
291 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 ...
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
117 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
50 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
41 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
131 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
926 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
60 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
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
907 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
1k 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
106 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.