Questions tagged [bash]

The Unix shell formerly used by Terminal in macOS until 10.15

Filter by
Sorted by
Tagged with
0
votes
0answers
12 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
29 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
13 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 ...
1
vote
2answers
65 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
35 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
29 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
9 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. ...
2
votes
1answer
64 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
30 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
44 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 ...
0
votes
0answers
29 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
60 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
41 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
27 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
143 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
116 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
165 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
208 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
44 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
332 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
59 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
23 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
79 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
83 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
80 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
35 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
89 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] ...
5
votes
3answers
493 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 ...
0
votes
2answers
72 views

Automator Change to directory of dropped files before running Shell command

Seems extremely simple, but I can't figure it out... I want to be able to change to the directory (folder) where the dropped file is located before running my shell script on that file. So either I ...
1
vote
1answer
337 views

'ls' command not working on mac OS Catalina

Ever since updating my mac to OS Catalina I have noticed quite a few changes were made to the terminal. Upon opening the terminal there is always the entry: The default interactive shell is now zsh....
0
votes
1answer
36 views

Keep standalone bash script app open after run of script

I have a bash script that I have turned into a standalone macOS app (i.e. I created a folder Script.app which contains subfolders Contents and MacOS and in the folder MacOS resides my bash script). If ...
1
vote
0answers
20 views

using breakpath command in shell file

From somewhere I have available in the macOS 10.15.1 Terminal window the command "breakpath", which gives as output the entries in $PATH, one per line. And I can redirect its output, e.g.: breakpath &...
1
vote
1answer
22 views

Shell variables in standalone app of bash script

I have a bash script that mounts a fuse filesystem created with the backup tool borg. Mounting the filesystem requires a passphrase. The mount command of borg allows to read the passphrase from an ...
3
votes
1answer
66 views

Path into PS1 prompt is broken (\n) on different lines when it is too long

I am using iTerm2 on MacOS Catalina . Here is my PS1 into ~/.bashrc , using a function ps1 : function ps1 { # PROMPT SECTION BLUE='\[\033[0;34m\]' LIGHT_CYAN='\[\033[1;36m\]' ...
2
votes
0answers
62 views

macOS Terminal not using correct manpath

How to set $MANPATH or manpath for the macOS Terminal Help menu command: Open man Page for Selection? Having recently done a clean install of macOS Mojave (10.14.6), I am trying to get my macOS ...
0
votes
1answer
28 views

Basic 'print' & 'puts' Mac OS terminal commands not found

I followed this article to install & update ruby with a package manager but I clearly messed up somewhere. https://stackify.com/install-ruby-on-your-mac-everything-you-need-to-get-going/ If I ...
0
votes
1answer
39 views

Copying all files of specific type to a specific folder using Mac's Terminal

How can I copy all files of specific type to a specific folder using Mac's Terminal. find . -name '*.STY' -type f -print0 | xargs -0 -I '{}' /usr/bin/rsync -avR "{}" "./styleFiles_chekad/" Above ...
1
vote
1answer
53 views

macOS catalina ignores shell in AD and uses zsh instead

We have Catalina hosts connected to our AD domain. Directory Utility shows AD users having /bin/bash as their shell (in Directory Editor), and the default shell for the domain is /bin/bash (in ...
1
vote
1answer
30 views

MacOS - Where is Terminal themes/profiles utilized by Terminal.app on disk?

I know i can export a profile, i can then use it, but if I modify it, i have to export it again, to have a proper backup. I'd rather have a symlink to the actual file in use by terminal rather than ...
0
votes
1answer
123 views

Enabling /bin/bash on Catalina - invisible to System Preferences -> Security & Privacy -> Full Disk Access

I am having trouble enabling /bin/bash on Catalina - Macos 10.15.1 When I try to enable it using "System Preferences -> Security & Privacy -> Full Disk Access", the pop-up finder list doesn't ...
1
vote
1answer
71 views

How to get rid of (base) inside terminal app in 10.14.6?

when I get a fresh terminal, my prompt says (base) ~> The (base) part is something that seems new. Was this added during a recent update? How do I get rid of it? There is one piece of ...
1
vote
1answer
34 views

My ifconfig: command not found for some reason

I'm using Mac Sierra version 10.13.6 and when I try using ifconfig it just outputs -bash: ifconfig: command not found And, when I run $PATH, I get: -bash: /usr/local/bin:/Library/Frameworks/Python....
1
vote
1answer
237 views

Can't use zsh shell in Catalina

When I opened Terminal after installing Catalina, this appeared: The default interactive shell is now zsh. To update your account to use zsh, please run `chsh -s /bin/zsh`. For more details, please ...
7
votes
4answers
822 views

How to prepend a character to start of each line in 250,000+ line file using a script?

I have text file with 250,000 lines - and I need to append the same single character at the start of each line. I have tried to use various multiline /column edit plugins in Atom and Sublime but they ...
0
votes
1answer
27 views

Unexpected behavior of bash script used to sync dotfiles

I'm using essentially this script for keeping my dotfiles under version control. I recently added a snippets folder inside my emacs.d directory and listed it as one of the things that should be ...
1
vote
1answer
34 views

Copy paste string to terminal leave a dangling empty area appearance

If you see the bell on the title, it means when I deleting string it was reaching $ sign and give a bell warns. But the strange thing is my cursor is not completely clear the string, it is still ...
0
votes
0answers
72 views

Running but not sourcing `~/.bash_profile` on file-write

I have an odd but no-longer-reproducible issue with iTerm2 and Bash. My default iTerm2 profile uses /usr/local/bin/bash (Bash 5 installed with Brew) with no arguments. I was trying to determine when ...
12
votes
2answers
3k views

:wq command not found

When opening terminal, this line shows every time: -bash: :wq: command not found How can I stop it from appearing every time Terminal opens ?
1
vote
1answer
67 views

com.apple.xyz.plist - replace value - not set key - possbile?

I've looked into using PlistBuddy and plutil but most examples such as: How do I replace a value in an plist array using plutil? seem to suggest setting the value of a key, which is not the case ...
1
vote
2answers
207 views

cron lacks permissions to run a script

I have a script (which backs up, using rclone) that I can run from the Terminal or Automator after chmod a+x, with no permissions problems. However, when this script is run in cron (or launchd), ...

1 2 3 4 5 27