Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [bash]

The default Unix shell used by Terminal in macOS

114 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
130 views

Apple's online version function support-sp.apple.com/sp/product?edid= does not work for all macOS versions

I would like to get the Apple marketing name, the code name, for a given version of macOS (e.g. 10.12 is macOS Sierra) from Apple's online service at support-sp.apple.com/sp/product?edid=. This is ...
4
votes
0answers
115 views

iOS Cannot SIGINT or Ctrl+C when SSH'ed into it

I have a jailbroken iPhone that I often SSH into. For some reason, I am unable to Ctrl+C a foreground process or kill -INT a background process when said process is started in an SSH session, but I ...
4
votes
0answers
922 views

iotop on High Sierra

I seem to have issues with iotop on High Sierra, googling it I find no useful information. The output is garbled and almost unusable. I have SIP disabled for dtrace (I know "I'm not suppose to do ...
4
votes
0answers
54 views

Is there a way to run a bash script everytime I print something?

I wanted to run a script that changes my background image whenever use the printer. Is it possible? Is there a way to know when OS X is printing something?
4
votes
0answers
2k views

How to use nohup/send process to background on os/x

The command nohup <command> & does not actually work properly on mac it seems: the process is suspended. Issuing fg appears to be required to reactivate the command. Here is an ...
4
votes
1answer
511 views

How to schedule run of .command file (bash)?

I have a bash script (saved as myfilename.command) and would like to schedule its run. I've tried to use Calendar event for this (which works fine with Automator scripts), but I get the following ...
4
votes
1answer
1k views

Set file metadata attribute values

I'm trying to set the values of some file metadata attributes in OS X Yosemite - kMDItemDateAdded and kMDItemLastUsedDate - the values of which can be shown using mdls <filename>. I'm trying to ...
3
votes
0answers
18 views

How to add a terminfo entry systemwide?

I would like to add terminfo entries systemwide for rxvt-unicode and rxvt-unicode-256color. However, when I try to run: HOST:terms alexreinking$ ls rxvt-unicode rxvt-unicode-256color HOST:...
3
votes
0answers
57 views

How can I detect which button was clicked in the DMG EULA confirmation screen

I'm using the open command to automate (via bash) opening a dmg which has a EULA attached to it. When I run open my_app_distribution.dmg I get a screen that looks like this: The open commands uses ...
3
votes
0answers
339 views

Bash script detect received iMessage along with its contents?

I've been doing some searching around online for an answer to this question and can't seem to find one. My aim is to run a bash script which waits for the arrival of an iMessage from a specific ...
3
votes
0answers
2k views

How can I mount Google Drive File Stream before launchd user agents start?

I have a simple backup bash script that dumps the output of pg_dump for a PostgreSQL database into a Google Drive File Stream directory. This bash script is referenced by a launchd user agent. The ...
3
votes
0answers
542 views

Opening new Firefox window from command line while it's already running

Does anyone know how to open a new Firefox window from the command line while Firefox is already running? I can't find any solutions currently out there that work for me. I've looked at the MDN web ...
2
votes
0answers
28 views

Opening terminal from command line, starting bash and got to the same location where the original terminal was

For example, I have a terminal (running /bin/bash) opened at a certain folder. Now what I want is when I type trm on the terminal, it will open another terminal at the same location where the first ...
2
votes
0answers
50 views

Mac Terminal Slow after upgrading to PHP7.3

I had my Mid 2013 macbook air running Mojave (10.14.5) with PHP 7.1.23 updated to PHP 7.3 from https://php-osx.liip.ch/ using the command curl -s https://php-osx.liip.ch/install.sh | bash -s 7.3 . ...
2
votes
0answers
378 views

Create User via Terminal with Bash in macOS Mojave

In general, you can create a user via Terminal in macOS using Apple's documented method. However, macOS Mojave introduced various security mechanisms that cause scripts to fail when changing user ...
2
votes
0answers
205 views

Bash autocomplete in Terminal stops working after a while

Bash allows auto-completion using the tab key: If you type cd ~/D on Terminal, followed by the Tab key, you ear a beep, but if you follow by a second Tab key, the Terminal display the suggestions ...
2
votes
0answers
97 views

What are .backup files and how do I remove them?

I'm working on removing hidden files from a directory, but keep running into issues with .backup files. I keep getting permission denied notifications even when using sudo. I'm not sure where they ...
2
votes
0answers
22 views

Processes display not allowing page down

The display hangs on one page after I invoke process through command top, Press 'space', 'arrow' take no effects. I got recommend to use htop, but find it complicated to manipulate. How to page top ...
2
votes
0answers
72 views

path difference on script vs in shell

Why is the output of $PATH different when in a script vs when running $PATH from the terminal? Even for a minimal script like this: #!/bin/bash echo $PATH it will not match what I get when typing in ...
2
votes
0answers
75 views

Errors with 'echo [A-Z]*'

Errors with 'echo [A-Z]*' I am working on the root directory and intending to print those starting with upper letter. $ echo [A-Z]* Applications Library Network System Users Volumes bin cores dev ...
2
votes
0answers
254 views

Can I modify iTerm window titles for some but not all running commands?

I was looking for a solution to auto set custom title in the terminal based on what command is being run on the current terminal. So, rather than java showing in many tabs - I'd love to have it pick ...
2
votes
0answers
285 views

bash in iTerm2: how to log variables like $TERM_SESSION_ID into command history

To help with recovering history across restarts etc I would like to get some key data, like $TERM_SESSION_ID, stored in my command history. This would be preserved when the command response output in ...
2
votes
0answers
65 views

Where do I find what's all affecting my $PATH?

When I echo $PATH I get: /Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/arukaj/Library/Android/sdk/platform-tools/:/Applications/XAMPP/...
2
votes
0answers
148 views

How to properly esca‌​pe spaces in the res‌​ults of mdfind to use them in a for loop

Trying to answer the question Are true dynamic folders (NOT a “Smart Folder” SavedSearch) possible? I stumbled about the problem to loop the results of an mdfind search as quoted or escaped paths. ...
2
votes
0answers
3k views

Terminal (bash) - copy files from Windows (SMB) shares without mounting

In past OSX versions, one could copy files from SMB shares like so: smbclient //my-server/foo -U USER%PASS -I 127.0.0.1 -c "get my.file" However, in recent versions, sbmclient has been replaced ...
2
votes
0answers
2k views

macOS new logging api (unified logging) log stream

Questions: 1) How can we redirect the log stream from stdin to, for example lnav? Currently, I use bash | (pipe), but I would like to hear if there is a better way to do it - the pipe buffer flow is ...
2
votes
0answers
111 views

open -g command still opens application in the foreground

When I run the command open -ga /Applications/Google_Chrome.app http://example.com the application behaves normally and opens the url in Chrome without bringing the application to the foreground. But ...
2
votes
0answers
280 views

Set up a Mac to run OSX (None Browser) application in pure kiosk mode

I've been trying for a number of months, using many methods, to run a Nuiteq Application called Snowflake on our 10 Mac Minis attached to touch-screens in pure Kiosk mode. I'm using Yosemite. These ...
2
votes
0answers
47 views

Using CTRL with bash

Coming from year on Windows, I swapped Cmd and Ctrl buttons. On bash I used to press Ctrl+A/Ctrl+E for jumping to the beginning/end of line. But, since I swapped the buttons I need press Cmd+A/Cmd+E. ...
2
votes
0answers
464 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 ...
2
votes
0answers
133 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 ...
2
votes
0answers
166 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}\...
2
votes
0answers
89 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 ...
2
votes
0answers
130 views

Determine when an application last launched

I need to have a script return a date that a particular application launched (in this case Parallels, but solution should be non-specific) so that our asset management system can mark the license for ...
2
votes
0answers
519 views

Bash script to import RootCA and set it to Always Trust from Server

I am working on a way to import a RootCA into the login keychain of OS X and set it to always trust, the cert is located on a file share server. I am relatively new to the whole Bash scripting scene ...
2
votes
0answers
676 views

How to make files safe so users can download and OS will not quarantine them?

I work with Axure software that generates dynamic and navigable prototypes in HTML. Once they are done I need to send a ZIP file of those HTML files to clients via e-mail or any download internal ...
2
votes
0answers
810 views

bash autocompletion scripts in OS X

Here is what I learned so far: # settings on mac if [[ $(uname) == "Darwin" ]]; then # enable bash completion if [ -f `brew --prefix`/etc/bash_completion ]; then . `brew --prefix`/...
2
votes
2answers
1k views

How to Poll USB mouse through terminal in El Capitan

I've been trying to view which devices are connected to my USB ports through terminal in El Capitan, in particular a USB mouse. I've read online that I can ls /dev/tty.* to view all connected devices. ...
1
vote
1answer
37 views

Command line “open DIRNAME” fails (but “open FILENAME” is OK)

In a terminal (or xterm, or emacs) window, the command: open dirname (where dirname is . or /tmp or /home/fred) doesn't open the the specified directory in Finder. However: Opening a non-directory ...
1
vote
0answers
27 views

How to pass filename as an argument passed on launch?

I would like to pass the script's filename to the "Arguments Passed On Launch" found in the Scheme editor under "Run". I looked at this Xcode documentation but did not find an answer. Currently, I ...
1
vote
0answers
32 views

How to associate file extension with executable using bash?

In my bash script setup.sh, how to make macOS associate .foo extension with /usr/local/bin/bar, so that I can click on X.foo in Finder (say) and have macOS perform /usr/local/bin/bar X.foo?
1
vote
0answers
164 views

iTerm2 still opens old shell after Bash upgrade

I tried upgrading my MacOS Bash from 3.2 to the latest version as in this article. It involves installing the latest Bash with Homebrew and then setting the default shell with chsh. However, chsh ...
1
vote
0answers
161 views

Change keyboard layout automatically when external keyboard connected

I recently purchased an external keyboard (non-apple) that is used at home and also dragged along with me from time to time, and I've noticed a need. My Mac is in English, as well as its physical ...
1
vote
0answers
71 views

“sudo chmod 0 /” deployed as script to remote MACs via Landesk

This probably will not make a lot of sense. We have users that have left the company and have not returned their macs. We are using Landesk as main managing platform, however the MAC managing part is ...
1
vote
0answers
22 views

Is it possible to create exs24 files with a script?

Say that I have a hundred samples and want to make an exs24 instrument for each of them. Is there any script where I could input some info like name, key and path to the audio file and then have it ...
1
vote
0answers
89 views

Terminal Startup command not found

Whenever I open my terminal there is a line that reads, -bash: 6ee67d3f2005ceaf5266c966198b7f3c165bf5d7: command not found This is shown after the line that states my last login information. I am ...
1
vote
0answers
188 views

Set globstar to act recursively

In the answer to question about enable wildcards recursive: bash - What expands to all files in current directory recursively? the globstar could be activated by shopt -s globstar: I post snippet ...
1
vote
0answers
64 views

How to close a mission control space using hotkey?

Using "Better Touch tool", I have a hotkey set to "Add New Space To Mission Control". I would like to create the inverse of this and set a hotkey to close the current space. Specifically, I would like ...
1
vote
0answers
25 views

Booting from another partition via bash

I want to create a little bash script that restart my mac and boots from another partition. Of course I could do that with changing the startup partition, but that would cause that it would always ...
1
vote
0answers
160 views

Monitor /private/var/log/system.log for connected users

How do I monitor system log for lines like: <host> sshd: <user> [priv][<process>]: USER_PROCESS: <process> ttys000 I'd like to automate an AppleScript / bash script to ...