The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

0
votes
0answers
4 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
29 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
53 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
96 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
16 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
26 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
60 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
23 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 ...
7
votes
5answers
204 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
9 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
53 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, ...
1
vote
1answer
40 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
23 views

How to turn off bash_profile from automatically opening when opening Terminal?

I recently changed the ownership of the .bash_profile file from root to MyUsername. Since then, when I start/open Terminal, the bash_profile file automatically opens too. To disable it from doing ...
0
votes
0answers
42 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 | ...
0
votes
2answers
59 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
52 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
48 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
96 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
54 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
29 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
44 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 ...
3
votes
1answer
45 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
181 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
194 views

How can I display contents of trash using terminal?

How can I display contents of trash using terminal?
3
votes
1answer
44 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
20 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 ...
25
votes
5answers
4k views

Did `man ls > temp.txt`. Output textfile is corrupted

When I execute man ls > temp.txt the output text file is corrupted. By corrupted I mean that first and last letters in some words are overly repeated. Several first lines in temp.txt: LS(1) ...
0
votes
2answers
44 views

Dock shortcut for an interactive bash script

I'm new to OSX and all I want it an application shortcut in Dock that opens the terminal and types the first command and waits for me to provide the password. Here is the script I want to run: ...
0
votes
0answers
40 views

Mac doesn't recognise simple commands like 'ls'

I installed Apache and tried to change the permissions for one of Apache's working directories. After that my machine keeps changing the default path. I can't access the simple commands unless I set ...
0
votes
0answers
29 views

using FISH shell — set default folder for multiple tabs?

I'm using fish shell in OS X. Using the standard bash shell, you can open multiple tabs in Terminal, cd to a different directory in each, and then save the setup as a Window Group (via Window > ...
0
votes
0answers
59 views

Stealthy Mac, Disabling network services on OS X (Non-Server)

I have written a bash script to harden OS X Security and be as stealthy as possible. The script: Disable bonjour Start firewall and block all non-essentials incoming traffic Enable Stealth Mode to ...
0
votes
1answer
198 views

OS X 10.10.4 Yosemite, has the default PATH changed?

Today I had to configure a new macbook, running 10.10.3 out of the box and immediately upgraded to 10.10.4. After installing homebrew I went to configure the default PATH, and opened /etc/paths. I ...
1
vote
0answers
23 views

In bash script, how to have a script that runs in the background and starts when an application is opened

I'm making a script which should run when I open Safari. I want it to open when the user logs in and run in the background, then have part of the script to run when Safari opens. Is this possible in ...
1
vote
1answer
84 views

Turn Wifi off/on with a single key?

Is there a way to assign the WiFi on/off function to one of the function keys like F4 that I otherwise never use? I assume Applescript would be required. However I may want to use a BASH script ...
0
votes
0answers
36 views

Nano: how to obtain syntax highlighting?

I have a default installation of nano under /usr/bin/, and I am trying to make nano highlight the bash scripting language code. I have been searching around, but I had no success: I got always some ...
0
votes
0answers
47 views

Show Google Search in Address Bar in Safari v8.0 in OS Yosemit

I'm trying to show/hide google search in Safari v8.0 in mac os "Yosemite" using bash script, I used the following command in terminal but it didn't work even after I restarted Safari, so am I doing ...
0
votes
1answer
49 views

Enable Web Inspector in Safari v 8.0 in Yosemite OS

I'm trying to show/hide the web inspector tool in mac os "Yosemite" using bash script, I used the following command in terminal but it didn't work even after I restarted Safari, so am I doing ...
1
vote
1answer
31 views

How to hide favourites bar in mac os using bash script?

I'm trying to disable and enable the favourite bar in mac os "Yosemite" using bash script, I used the following command in terminal but it didn't work even after I restarted Safari, so am I doing ...
0
votes
0answers
20 views

AppleScript and Configurator

I have written a bash script to modify a mobileconfig file (iOS profile in a xml-plist format) as per this link and I am now in the process where I would like to interact with Configurator via ...
0
votes
2answers
185 views

Update bash to version 4.0 on OSX

Is it possible to actually update bash to version 4.0 in OSX Yosemite? echo $BASH_VERSION 3.2.57(1)-release This article and this thread refer to the same question, but they install a new shell ...
0
votes
1answer
29 views

Paste tool for OSX

There is paste tool in Linux but have not found for OSX. Its name was probably dpaste or something in Linux. Assume you run xxd -ps r328.raw | head -n2430 and you want to paste it to your friend. ...
0
votes
1answer
33 views

What is the “host name” in bash? (\h or \H)

I set PS1="[\u@\H \w] in bash. So it should print the host name. But I do not understand the meaning and nature of the host name. Basically, I would assume that it is just a name I assigned to my ...
0
votes
1answer
91 views

Warnings when installing pip

I just installed pip and got a few warning messages. Should I be concerned? Is there a way to check that pip was installed properly? Here's what I did: [mchenja@mycomp ~]$ sudo easy_install pip ...
0
votes
0answers
22 views

How to open application through notification in terminal shell

I have the following command to run in a terminal shell script: osascript -e 'display notification "This is a Text" with title "This is a Title"' This is a shell code running in applescript to open ...
2
votes
1answer
341 views

Removing computer name from terminal

Right now, this is what my Terminal shows: MyName's-MacBookPro:location MyName$ I'd like for it to only show my name, so something like this: MyName$ When I browsed online for a solution, they ...
0
votes
3answers
90 views

I broke PATH in terminal and I can not restore it

in .bash_profile I accidentally set the path to: PATH="~/Tools/apache-maven-3.3.3/bin" and now the default path is gone. Nothing in Terminal works anymore: Korays-MacBook-Pro:~ koraytugay$ ls ...
0
votes
0answers
14 views

Check access to share BEFORE mounting

Quesiton: Can I check access to a share before I mount it? I'm using various bash scripts on Mavericks 10.9.5. One script mounts shares, based on group membership. Due to the nature of the script, ...
1
vote
2answers
275 views

Install Monokai Theme on Terminal with prompt colors, etc.?

I already have a Monokai theme installed in Terminal, as so: I was wondering how I could get the rest of the Monokai (as Sublime uses) into Terminal? Like, making the prompt (Gamma@~) colored, etc. ...
0
votes
0answers
42 views

os.Popen command is not working

I'm writing a python script that is suppose to change default display settings for all users. I run the script as sudo because it needs to change every display. This line is suppose to change the ...