Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [bash]

The default Unix shell used by Terminal in macOS

4
votes
0answers
93 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
94 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
825 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 ...
3
votes
0answers
262 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
473 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 ...
3
votes
0answers
41 views

Checking if option is selected under System Preference on Mac

I have an issue with AD binding on Mac. Computer shows its already bind to AD but won't allow domain logins. What I noticed is "Allow network users to log in at login windows" option is grayed out. I ...
3
votes
0answers
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 ...
2
votes
0answers
100 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
128 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
96 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
63 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
163 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
216 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
58 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
122 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
2k 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
99 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
272 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
45 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
392 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
125 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
158 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
71 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
129 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
486 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
645 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
761 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
0answers
100 views

What's the /home directory for, or did I just accidentally create it?

I saw reference to a bash command, cd /home, in a multiple choice quiz about navigating within Terminal. I tried it, expecting -bash: cd: /home: No such file or directory, but to my surprise it took ...
1
vote
0answers
56 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
74 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
58 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
18 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
56 views

iTerm2 - Split vertically with same command history

Is it possible to have same history of commands when I split window vertically in iTerm2 with Command + D as in current window? For example history command shows different list of commands, looks ...
1
vote
0answers
65 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
41 views

Moved /usr/bin and /usr/lib folder, how do I fix it? (iOS 10.2.1, iPhone 6 +)

So long story short, I was trying to free up storage on my root partition, and I made a stupid mistake. I moved my /usr/bin and /usr/lib folder to /var/stash/bin and /var/stash/lib respectively. ...
1
vote
0answers
140 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
54 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
148 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 ...
1
vote
0answers
340 views

copy text inside terminal.app without mouse

I'm inside a terminal.app with about 20 lines of commands and it's output $ previous command previous command output $ git branch develop master * you/236-add-more-test $ previous ...
1
vote
0answers
486 views

Terminal 'ls' command not showing files when newly generated

I generate files to the public folder using ng-cli from my terminal Using this command ng build Another terminal is open to the public folder while files are generated ... I run ls but it's not ...
1
vote
0answers
90 views

Audio when connecting to and from monitor

I have my monitor Dell P2415Q connected through thunderbolt and the speakers connected through aux to my Dell monitor, so that I don't then have 5 cables going into my mac instead of 4 (Dell USB Hub, ...
1
vote
0answers
68 views

Reverse IP lookups return default reverse domain pointer

Whenever I query ARPA for the reverse entry for an IP through the host command, I get a correct lookup result at first. Example: MacBook-Pro-van-William-David:~ server$ host brc.nw1-ams1.mcxpro.nl ...
1
vote
0answers
31 views

Specify separate icon and name for each instance of an app?

For example, if I have a command line program (say nano) I want to launch directly with a shortcut, but I want the new instance of Terminal.app to have a dock icon depicting nano running in a terminal ...