The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

0
votes
1answer
104 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
64 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
78 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
20 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
318 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=() ...
0
votes
2answers
846 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
159 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
59 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 ...
0
votes
1answer
160 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
171 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
52 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
77 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 ...
0
votes
1answer
29 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
51 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
16 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 ...
4
votes
1answer
485 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
212 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 ...
2
votes
1answer
799 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
19 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
23 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 ...
0
votes
0answers
39 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 ...
3
votes
1answer
207 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
99 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
154 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 ...
1
vote
4answers
167 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
315 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
526 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
76 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 ...
8
votes
5answers
3k views

How to create an OSX Application to wrap a call to a shell script?

My goal is to include in a zip file what amounts to a shortcut, instead of telling my customer(s) to open up Terminal and run a shell script. My deployable essentially looks like this: $ unzip ...
0
votes
0answers
23 views

Bash Script to Login to server and copy a folder to local drive

I have created a nice netboot image that I use to fix computers that misbehave. Reformatting them and restoring from this solves problems for us all time and has proven to be a remarkably efficient ...
2
votes
3answers
84 views

bash completion in terminal - files vs folders

I just recently started out with MacOS, but there one some strange completion behaviour with the bash shell (compared to OpenSuse Linux with tcsh where I come from) that is bugging me: For example, ...
2
votes
2answers
532 views

Why is there a left bracket before my bash prompt?

I've notice that after I execute commands, a left bracket character will appear before the previous line. It seems to be partially dependent on what's in $PS1. I've tried unsetting $PROMPT_COMMAND and ...
0
votes
0answers
122 views

Conditional lsof loop in bash script

I found this example of a conditional lsof loop and want to adapt it to my situation. typeset fSrc="/path/to/sourcedir" typeset fTgt="/path/to/targetdir" while : ; do ls /path/to/sourcedir | ...
1
vote
2answers
428 views

Shell command to count pages in a PDF (other than pdftk)?

I have been using this to get a page count of PDFs in shell scripts in OS X: pdftk "$i" dump_data | grep NumberOfPages | awk '{print $2}' | tr -dc '[0-9]' (where $i is the PDF filename) However, ...
2
votes
1answer
84 views

Bash script with lock folder problems for large files

My script is: #!/bin/bash # Path to a lock folder LOCK_PATH="/Volumes/PROOFS_WATCH/copy.lock" trap 'rmdir "$LOCK_PATH"; exit' 1 6 15 if mkdir "$LOCK_PATH"; then echo "Lock file did not ...
1
vote
0answers
146 views

Mac Terminal (+bash +tmux +set-o vi) missing characters at end of line

Often when editing a historical bash command in vi mode (after pressing ↑), and then moving backwards in the text using b. When I begin editing the text after pressing i or a, the extra text I insert ...
1
vote
1answer
240 views

Bash script - Delay cp command until after file write is complete

cp /Folder1/*.mov /Folder2/ cp /Folder1/*.mov /Folder3 rm /Folder1/*.mov This runs every 60 seconds using Chron that copies any *.mov file from one folder to 2 other folders and then removes the ...
0
votes
1answer
136 views

How to create a 'Sharing Only' account via terminal in OS X?

I'm attempting to create a 'Sharing Only' account in an OS X app. I've tried code based on examples like these: Can user accounts be managed via the command line? What steps are needed to create a ...
1
vote
2answers
37 views

Formatting 'defaults domains' output on multiple lines

Just a quick question here. I'm trying to format the output of the command: defaults domains so that it puts each domain on a new line, so I can use that parsed output in a different command. I've ...
3
votes
1answer
205 views

Running shell scripts in single-user mode

I'm planning on running a couple of scripts in single-user mode to speed up (and simplify for less savvy users than myself) the configuring of a few aspects of some Macs that I set up for other ...
4
votes
1answer
154 views

Put Back from trash from Terminal

I sent a lot of files and directories from an external hard drive into the trash by mistake. All those files and directories had the same grandfather directory but not the same father directory. I can ...
0
votes
0answers
18 views

How to undo a $PATH variable change? [duplicate]

Is it possible to undo a change to the $PATH variable on OS X Yosemite? I was trying to add to the $PATH and accidentally changed the entire thing to one path. I just need to know if I can undo this ...
2
votes
1answer
2k views

Changing MAC Address and undoing changes

I was trying to change my MAC address. I saw an answer that suggested I disassociate my device with this: sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z sudo ...
4
votes
2answers
228 views

How can I display contents of trash using terminal?

How can I display contents of trash using terminal?
3
votes
1answer
277 views

Permanently saving changes to $PATH [duplicate]

I have ruby and homebrew running for a while and I'm starting to play with Bash. I have encountered a problem with my PATH variable as echo'd: ...
2
votes
0answers
42 views

Terminal: disable printing/output of keyboard commands

I have the same problem as this person – I am running a C script and somehow when I pass the EOF signal with Ctrl+D, ^D gets printed to the console. My question is therefore: is it possible to ...