The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

1
vote
1answer
84 views

Bash script not working on Automator but working from terminal

I have this bash script that works perfectly on terminal #!/bin/bash for f in "$@"; do DIRNAME="$(dirname "$f")" filename=$(basename "$f") name="${filename%.*}" extension="${filename##*.}" ...
1
vote
2answers
65 views

How can I run an unsigned script in Automator

I can run the well-respected perl script exiftool from the command line in Terminal and achieve the desired result, but when I incorporate it in Automator as a Service I get a generic error message ...
2
votes
0answers
38 views

Grant rights on a certificate to an app through the shell

I'm currently looking for a way to grant an application rights to a certificate in my /Library/Keychains/System.keychain through the shell. I can currently do this through the Keychain Access App by ...
0
votes
0answers
32 views

Encrypt password on disk for scripting

In the Microsoft Windows platform, there is a service called the Data Protection API (DPAPI), which allows developers to easily encrypt and decrypt values using a simple set of APIs. The encryption ...
1
vote
2answers
149 views

VLC command works in Terminal but not Automator

If I run this in terminal it works fine /Applications/VLC.app/Contents/MacOS/VLC -I rc http://open.live.bbc.co.uk/mediaselector/5/select/mediaset/http-icy-mp3-a/vpid/bbc_radio_fourfm/format/pls.pls --...
7
votes
1answer
6k views

Missing .bash_profile and .bashrc files

I don't have .bash_profile or .bashrc files and I am definitely using the bash shell. I am using Mac OS X 10.11.1 El Capitan. How do I permanently modify my $PATH to cut down the default values Apple ...
1
vote
2answers
91 views

Prevent terminal tabs from auto-renaming

I like to name my tabs when I'm using Terminal so I can keep track of what's inside of them. I do this using the inspector. Unfortunately, whenever I ssh into a machine, my tabs get renamed. Is ...
1
vote
0answers
18 views

Automating VPN switching

I can us a VPN app like tunnelbear to appear to be in other countries, but is there a way to do this in a bash script or applescript? I want to be able to run automated tests on my iOS apps (in the ...
0
votes
2answers
196 views

How to re-install deb package from MobileTerminal (iOS) [jailbroken]

I am trying to run a command to re-install an already installed package. Here is what I see that gives me a clue that I am on the right path, but it doesn't install the package: su ****** apt-get --...
2
votes
1answer
30 views

Launch different apps based on file name (other than the extension)?

I'd like to have different apps handle .jpg files based on a naming convention I'll use for the .jpg files. Specifically most will go to Xee, but ones containing thumb should instead cause VLC to be ...
2
votes
1answer
786 views

Unable to set DYLD_FALLBACK_LIBRARY_PATH in shell on OSX 10.11.1

In shell scripts used for unit testing with dynamic libraries in a directory other than the typical @rpath, I have previously been able to set DYLD_FALLBACK_LIBRARY_PATH to set the directory ...
2
votes
0answers
76 views

Terminal hangs when title includes unreachable NFS path

[Edit: reframing to make the question more clear] I use the Mac Terminal to access remote linux systems. On the Mac, the bash prompt is set by: PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}\...
1
vote
0answers
30 views

-bash: 1: command not found - Immediately on loading Terminal [duplicate]

Upon loading my terminal (since trying to install composer globally) I'm being spammed with countless amounts of -bash: 1: command not found before I even type any commands. I'm not quite sure what ...
0
votes
1answer
25 views

What apps use ~/.bash_profile?

I accidentally deleted my ~/.bash_profile, and want to know which apps will go down. What most common apps (development apps) use this file?
3
votes
3answers
219 views

Display interactive notifications (with buttons) via Terminal

I'd like to let my bash shell scripts to display gui notifications with two buttons that the user can click and then execute some commands depending on the button pressed. What options exist?
1
vote
2answers
3k views

Bash script not found El Capitan

I have created a Bash script that simply does ls -l. In Mavericks and older versions of OSX I simply made a symlink to the script and put it in the /usr/bin folder (ln -s ll.sh /usr/bin/ll) and I ...
0
votes
0answers
64 views

Running shell commands from netcat

I have a shell script that I am serving up through netcat - I'm using this as an experiment to learn more about unix I can now do nc 127.0.0.1 1234 | sh and it will pipe the script commands into the ...
1
vote
1answer
90 views

git auto-complete branches with checkout alias

There's this neat script to autocomplete git branches. It works fine with git checkout <tab>. But, I want to take it further. I have a checkout alias: alias co='git co'. How can I make branch ...
0
votes
1answer
132 views

bash script to verify that brew cask is installed

I am writing a script to setup a mac development environment, however I am running into an issue on some peoples macs where cask does not install. Is there a way I can verify if cask has been ...
0
votes
1answer
68 views

Command to find process and restart it

I have an issue with my Logitech Mouse software always crashing when it switches between different power modes, this crashes their software on Mac OS X (Yosemite). The app is used to control the ...
1
vote
1answer
30 views

Permission Denied for apropos command

I'm trying to list the contents of the whole apropos (makewhatis) database with the following command but I keep getting Permission denied. sudo -s apropos . > touch thedatabase -bash: touch: ...
1
vote
1answer
82 views

Run Terminal Command from .terminal file

I just figured out how to export settings from terminal which creates a .terminal file. And I realize that the ExecutionString parameter has changed to the CommandString parameter. I put a command in ...
0
votes
0answers
23 views

Odd issue with iTerm2 (built from Git repo)

I'm currently using iTerm2 version 3, built from the GitHub repo. My default shell is bash, but I have iTerm set up in a way to default to using zsh on startup. I had this set so that the default ...
0
votes
1answer
326 views

Bash Autocomplete Script with El Capitan

About a week ago, I added the following to the end of my .bash_profile script so set up tab completion for man pages: function _man_pages() { local cur opts prev COMPREPLY=() cur="${...
1
vote
2answers
991 views

Install John the Ripper Jumbo

I've been following the instructions here for installing John the Ripper on my Macbook Pro (El Capitan). I've skipped the Iterm and Cuda sections (I have a Redeon GPU). All is well until I run make ...
0
votes
1answer
189 views

Bash command to calculate average on each row and each column

Suppose we have a log file like marks.log and the content looks something like this: Fname Lname Net Algo Jack Miller 15 20 John Compton 12 20 Susan Wilson 13 19 I want ...
2
votes
0answers
17 views

bash: ping: command not found [duplicate]

My shell can't find ping. $ ping -bash: ping: command not found $ uname -r 14.5.0 $ echo $PATH /usr/local/bin:/usr/bin:/bin:/Users/alex/.cabal/bin $ which ping $ However, man ping works and ...
1
vote
0answers
64 views

Adding a directory to $PATH doesn't work in Yosemite

I've tried to do it both ways: 1. I edited ~/.bash_profile like so: $ cat ~/.bash_profile export PATH="${PATH};~/bin" $ $ ls -l ~/.bash_profile -rw-r--r-- 1 myuser staff 202 Oct 1 16:57 /Users/...
0
votes
1answer
179 views

.profile is not loaded on non-login /bin/sh

The problem is in the title, but let me add few details here. I am running on OS X 10.10.5 (14F27). Using default Terminal.app. Content of config files Content of /etc/profile echo " # reading /...
2
votes
1answer
213 views

Why does Apple ship bash 3.2? [closed]

For several years I have been wondering why Apple ships new OS X releases with old version of Bash. I came across the question Update bash to version 4.0 on OSX where there is a mention of problem ...
4
votes
0answers
58 views

Terminal prompt 'saving' certain commands on up-arrow

I added a little bit of shell scripting to my prompt for fun. It alternates the colors of prompt items randomly. I did it purely because a gray screen gets boring after awhile. The following is my ...
0
votes
2answers
84 views

Softlink /bin/bash to a brew-installed bash

It is a question related to this other one, but I can't comment. I've updated to use bash 4 from brew installation. But I don't know if changing all the header scripts from: #!/bin/bash To #!/usr/...
0
votes
1answer
32 views

In terminal (bash), should I be in a folder to move it to another?

In a directory named World, I've been asked to move a folder within it--South_America--to another folder also within World--North_America. 1. I can't figure out if I should be in South_America or one ...
0
votes
1answer
52 views

Detect mouse move or keystroke

Is it possible to make a program execute when the mouse is moved or any key is pressed?
0
votes
1answer
17 views

Terminal not launching correctly, prompt does not appear until SIGINT

I am running OSX 10.8.5 (Mountain Lion). When I launch terminal, or a new window/tab within terminal, I don't get my prompt. The last login information gets displayed fine, and my cursor is set (...
5
votes
1answer
544 views

Using python screws up the shell (and/or terminal?)!

The problem Simply opening and closing the Python sub-shell screws up my shell (or possibly the terminal?). It seems to remove the shell's ability to print any text I enter, including newlines after ...
1
vote
1answer
238 views

Terminal - don't require password for shell script to run

I am running Yosemite 10.10.5 and I have a shell script which I want to use to toggle whether my wifi connections run through tor or not. This uses the networksetup a couple of times and so asks for ...
3
votes
1answer
957 views

Auto-updating Homebrew

i'm currently using the Homebrew package manager and my question is: is possibile to write a bash's script in order to execute brew update and eventually brew upgrade whenever opening a shell for the ...
0
votes
1answer
21 views

macports: bash_completion not working with make (with gmake or without)

I've installed bash_completion from macports. Completion works fine for git, for instance, where I installed +bash_completion variant. Completion doesn't work for make, whether I install macports' ...
1
vote
1answer
25 views

zero pad numbers in `cal` (or `gcal`) output?

This seemed pretty easy, but I have not found a good way to do it. In Terminal, cal will give this output: September 2015 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
0
votes
1answer
76 views

Why is bash echoing instead of running Apple Script

I have a function in my .bash_profile that should allow me to add startup items. The only issue is this echo's a string instead of running the Apple Script. This is my function function addtologin(){...
0
votes
0answers
41 views

Terminal, set application to automatic launch at login

I am trying to automate the process after I reinstall OS X (I do it time to time due to messing things up), So far I have this script. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/...
3
votes
1answer
235 views

Non-debug qlmanage

I've got a bash alias set up in my terminal, alias quicklook='qlmanage -p ', in order to easily quicklook files from the terminal, but the output bugs me. Testing Quick Look preview with files: /...
1
vote
1answer
107 views

No commands installed from pip work in Terminal

I've been learning python and tried to install pep8, restviewer and other command line apps but when i try to run them, it shows a command not found error. -bash: restview: command not found I've ...
0
votes
0answers
182 views

.bash_profile is not working unless sourcing it manually

I got a new machine (yosemite osx), and I am trying to set it up. I have created .bash_profile, but unfortunately it doesn't work. Even if I log back in or restart the machine, and open terminal again,...
1
vote
4answers
175 views

Quote a filename in a script passed to chmod?

I'm having trouble quoting a filename that's eventually passed to chmod. The script was originally written for SSH's StrictModes and authorized_keys, but I had to expand it due to a bad UMASK that ...
0
votes
0answers
341 views

Enable remote management remotely on a mac

I am trying to use remote desktop to send a script to all Macs on my network that creates an additional admin account and hides it. I am trying to do this using Apple Remote Desktop. However most of ...
0
votes
2answers
866 views

Adding Gradle to PATH

I am trying to add Gradle to my PATH. I have used the command export PATH=/myUsername/Applications/gradle-2.6/bin:$PATH but when I type gradle I get an error "command not found." So I went to ...
3
votes
1answer
77 views

Why does this cause Mac OSX to print over SSH?

While screwing around and breaking things I came across these stupid commands (if executed in order it causes what I got): cd / && cat vmlinuz cd /boot/ && cat init* It causes ...
0
votes
0answers
30 views

Protect changes to plain text file written by standard user's execution of bash script

I have written a simple bash script that I want to use as a time clock for employees (work-studies) in my computer lab. The script works great. 1. Each work-study has two icons (two separate bash ...