Questions tagged [bash]

The Unix shell formerly used by Terminal in macOS until 10.15

Filter by
Sorted by
Tagged with
0
votes
1answer
68 views

Shell commands to determine if file is held on an APFS volume

In a shell script, I need to determine if a file is held on an AFPS volume. What is the easiest way to do that?
0
votes
1answer
31 views

Output folder contents to .CSV with alphabets removed from filename

I would like to turn the contents(filenames) of a folder into a .csv My problem is that the files are organised in sets. I only want to output the filename of each set without anything else but the ...
1
vote
1answer
26 views

pkgbuild open URL using default browser

I use pkgbuild to create an Apple installer .pkg. In my preinstall script, I have the following, which opens in Chrome if I invoke it myself, however when run by pkgbuild script, always opens the ...
0
votes
1answer
84 views

Installing Packages through Recovery Mode

Alright so at this moment my Mac only boots in recovery mode and I need to install a package (.pkg) before attempting to reinstall the OS. The package is located on a usb drive named "Package". I ...
0
votes
0answers
16 views

Why does launchd suddenly complain about error 78: Function Not Implemented? [long]

I have an old 2010 MBA which runs High Sierra. It is located at a condo which I visit for a few days each month. The machine runs 24/7 mostly to upload webcam photos to a host every four minutes, to ...
0
votes
0answers
36 views

Shell script sleep timing is off when run from Automator

I have a shell script that plays a mantra and three bells for meditation. #!/bin/bash log=~/Dropbox/code/meditation/meditation.log bell_path=~/Dropbox/code/meditation/meditation_bell/ echo $(date) ...
1
vote
0answers
43 views

Install for all users an Application from a DMG

I trying to install with a Bash script an Application like Slack when I create a new Macbook. Connected as the admin user I run those command sudo hdiutil attach -nobrowse /Users/admin/Desktop/post-...
0
votes
0answers
21 views

Modify/Wrap macOS System Plugin

I would really appreciate any advice on this. Introduction: I have both macOS Catalina and macOS High Sierra installed in my Mac. The former is on an APFS encrypted partition, and the latter is on ...
1
vote
1answer
53 views

Difference in executing a command line in a different ways

Just so I understand the difference between executing the command line in Bash Terminal macOS Mojave. Let's take for example the installation of a package named: stackexchange.pkg What are the ...
3
votes
1answer
67 views

Closing Terminal window does not kill script run with sudo

X-posting from unix.SE on recommendation. I have a bash script called testing saved within /usr/local/bin. In one Terminal window in macOS I run sudo testing. In a second terminal window, I generate ...
1
vote
0answers
25 views

Using bash/terminal to get battery draining apps

I have the following Macbook Pro model. I would like to find the apps that are consuming considerable power from the terminal so that I can kill them if I am on battery power. All searches so far ...
2
votes
0answers
31 views

Is it possible to add background music (with or without video) to the login screen on a Mac?

I've never seen this question asked before, and provided that Terminal exists I don't see why this wouldn't be possible. Does anyone know whether this is, or how they would make this possible?
3
votes
1answer
497 views

sudo: setrlimit(8): Invalid argument after switching Mac OS shell from BASH to ZSH

After updating to Mac OS Catalina some months ago, I followed the prompted suggestions and changed my shell from BASH to ZSH. Since that time, whenever I use sudo in Terminal, I get sudo: setrlimit(8)...
0
votes
0answers
11 views

Can I write a script which caffeinates itself?

I have a couple of bash scripts which I almost always start and then walk away from my computer to let them do what they do unattended because of how long they take (and because they are often ...
1
vote
1answer
54 views

When should we enable the `locate` command on a Mac?

The locate command in Bash is available besides find to look for files, but it requires building a database. On a Mac, how useful is this and in what situation(s) should we enable it? $ locate '...
0
votes
1answer
59 views

Creating a Service with automator, caffeinate

First of all, sorry for my english, not a native speaker. Since I'm a bit fed up opening Termninal and ^C I want to create a shortcut for activating caffeinate -d on my Mac OS X 10.11 I've been trying ...
0
votes
1answer
49 views

How to reset my terminal prompt to default - post mess-up

Whether or not it was a mess up, this seems to be over my head, and further reading would only get me deeper in trouble. Hence am posting here: What happened (verbose b/c I am not sure which is ...
0
votes
1answer
65 views

How To Convert a Terminal Command into an “.app” file? [duplicate]

I want to run a command every-time I click an app icon. I want that app icon in my launcher or app drawer and dock. The Command I wanna run is this (posted here) open -na "Google Chrome" --args --...
4
votes
2answers
230 views

Auto start an application using a script

what I would like to do is a script which 1st checks whether a list of applications is running (e.g. Spotify, Thunderbird, Rocket Chat) and 2nd launch the apps from this list which are not already ...
1
vote
1answer
74 views

Run shell script by double clicking in non-login prompt in terminal

This question is super similar to this, but I'm curious how to launch the shell script in a non-login shell prompt. I already have it set up to run with iterm2 when I double-click. I don't really care ...
0
votes
0answers
85 views

High Sierra - Terminal “messed up”

After a re-installation of macOS High Sierra on my MacBook Pro, I realised that the Terminal is kind of "messed up" (random substrings of the Terminal's current output are produced) when resizing the ...
0
votes
0answers
20 views

Create image from the colorized terminal output

This will output a black and white image: git diff --staged . | convert label:@- diff.png but I want the color of the text (as the red & green is useful). I guess to configure the background ...
0
votes
1answer
99 views

Unable to mount an SMB share from cron

I have a script to temporarily mount an SMB share and copy some files that get generated for my team. It works find locally, but fails to mount the remote share when run from cron. I am not including ...
0
votes
1answer
37 views

How do 3rd-party programs modify the $PATH variable?

When I echo my $PATH variable, I see the binaries of some programs that I have previously uninstalled, and conversely, I do not see the path to some of the binaries that I can use, such as code. I am ...
0
votes
1answer
19 views

pdfsplit fails to start

pdfsplit returns the following error when launched from terminal: pdfsplit --version -bash: /usr/local/bin/pdfsplit: Bad CPU type in executable OS: macOS Catalina 10.15.2 file Checking ...
2
votes
2answers
167 views

How to (and should I) put a path to user-installed python ahead of system-installed python?

I have a separate installation of Python 3.*, but the first python path in my $PATH variable is the path to system-installed Python. Is this how it should be? I have added the path to user-installed ...
1
vote
1answer
220 views

No package manager on brand new macOS Catalina

I'm sorry if this is a stupid question, but I've been searching for days with no results. What is the default package manager for macOS Catalina terminal? % brew zsh: command not found: brew I've ...
1
vote
1answer
405 views

How to conveniently restart pgAdmin 4?

I have pgAdmin on my dock, and can open it when the process isn't already running (ie. after a restart, or if I manually kill it). If I open pgAdmin, close the window, then later try to open it from ...
0
votes
0answers
13 views

Get iTerm notification when remote SSH session command is completed

I'm trying to make iTerm give me a notification whenever a command I run in an SSH session completes. To do this, I set marks whenever I run a command which notifies me whenever the command completes. ...
3
votes
1answer
165 views

How to get fn + left key working on macOS after changing to zsh from bash?

In case it is not clear fn + left key is simply the HOME button. It takes you to beginning of line. This seems to still work when editing a file (in vim) say so I think zsh does something with the ...
0
votes
0answers
38 views

How can I change the color of Terminal's shell prompt and create new empty line entering after a command?

I am trying to permanently change the bash prompt color to blue as well as create a new empty line after I run my command to make the terminal easier to read. Before I tried to make changes, I had ...
2
votes
2answers
116 views

Using the command-line / Terminal, is it possible to determine if this Mac has Touch ID or not?

I am trying to find a way, using the Terminal/command line, to determine if the Mac I am using has Touch ID or not. So far web searches have not turned up any answers. I would have thought that ...
1
vote
0answers
70 views

What makes Catalina make a shell script quarantined?

I am routinely editing shell scripts (bash). One of them gets quarantined whenever I modify it. When I run it, I get the error: $ ./opg.sh -bash: ./opg.sh: /bin/bash: bad interpreter: Operation not ...
1
vote
1answer
73 views

bash not finding executables on Catalina: why & how to fix?

As I was typing the title, I saw a suggestion that this might be a duplicate of. But the suggestion vanished before I could click on it. 'sh' is actually bash sh: sleep: command not found sh: ...
2
votes
1answer
95 views

Cron job not exiting in Catalina; leaving zombie processes [duplicate]

I just upgraded to catalina a few days ago. I'm still using bash which has been installed with homebrew. The ps aux | grep bash command is showing a new bash process is forked every minute. After a ...
0
votes
1answer
84 views

Batch rename files replacing non-alphanumeric characters with underscore

I would like to recursively rename several files located in all subdirectories of a parent folder. I would like to remove spaces and other non-alphanumeric characters and replace them with an ...
2
votes
1answer
982 views

-bash: /usr/local/bin/nmap: Bad CPU type in executable

I recently update my Mac OS to Catalina 10.15. I ran nmap I kept getting -bash: /usr/local/bin/nmap: Bad CPU type in executable I've tried reinstalling it brew uninstall nmap brew install nmap ...
1
vote
1answer
320 views

MacOS command-line security updates: equivalent for apt-get update all

I am accustomed to updating systems with sudo apt get update and would like to ensure MacOS security updates are installed from the command line. This `software update' command was issued on my ...
1
vote
0answers
167 views

PS1 setting on macOS using Modulo

I'm trying to set up my PS1 setting in my .bash_profile for my company laptop (Touchbar Mac) and noticed special characters like \u and \w were being used literally. I tried using the single and ...
0
votes
1answer
218 views

Add colours to output of existing CLI commands

I would like to create a function / alias that colorizes the output of another command. Is there a best-practice way to do so? For instance, let's take the alias command, whose output looks something ...
0
votes
0answers
74 views

Running “do script” synchronously in AppleScript

I have the following AppleScript that I run on login: on run {input, parameters} tell application "Terminal" do script ".../MyScript.sh" end tell return input end run I run ...
1
vote
1answer
2k views

How to set “default” .bash_profile when opening Terminal on Catalina

I'm running Catalina, 10.15.2, which uses the new zsh shell as a default. I've created my own .bash_profile file in my home directory and I'm able to initialize this .bash_profile by typing: source ....
2
votes
0answers
200 views

Run a command without opening the terminal

Is it possible to start a terminal command without opening the terminal first? I have some quick commands, and for those I open the terminal window, run the command, and close it again. I generally ...
0
votes
1answer
35 views

trying to run FSF emacs in character based mode ( -nw ) on Catalina

After installing Catalina on my laptop emacs vanished so I installed the latest version from FSF. Running it in a window (gui mode) works fine but I can't get it to reliably work in character mode in ...
0
votes
2answers
82 views

Bash - moved /Users/me to /usr/local/me - how to move it back and not break anything?

I was trying to set up Tomcat to use with Java, and somehow moved /Users/me to /usr/local/me. When I try to open any icons on desktop, they do not open, but everything that was already open still ...
2
votes
1answer
109 views

Process completed after opening terminal

I am running a bioinformatics course that gave the following instructions to setup my previously non-existing bash profile: You will need a few lines in your setup files. Open a Terminal and run ...
0
votes
0answers
151 views

syspolicyd assessment denied

My server has a bash script that executes twice a day, so far so good, it worked for a looong time. Yesterday I updated the server OS to Catalina and then the script stopped working. I've checked ...
0
votes
1answer
36 views

How can I run a command which will not survive terminal close?

I want to send a notification in X seconds to future me, but I don't want to send the notification if I closed the terminal. So let's say I want to send myself a notification in 10 seconds: ...
1
vote
1answer
164 views

Process completed immediately after opening Terminal and impossible to add commands

Since I have made some changes on my .bash_profile document, when I open my terminal I got this message and I cannot add any command : Last login: Thu Dec 19 10:02:58 on ttys000 [Process completed] ...
6
votes
3answers
1k views

Now that MacOS Catalina has moved to zsh, can I upgrade bash 3.2.57 with 5.0.3?

I understand apple's move from bash to zsh, though I'd really rather that they hadn't made the change. I've tried zsh, and decided that I'd prefer to remain with bash. So, since MacOS Catalina isn't ...

1
2
3 4 5
29