Questions tagged [bash]

The default Unix shell used by Terminal in macOS

Filter by
Sorted by
Tagged with
2
votes
1answer
33 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
69 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
29 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
70 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
39 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
105 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
53 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
15 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
67 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
71 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 ...
-1
votes
0answers
50 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
34 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
77 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
340 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
70 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
124 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
35 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
58 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
52 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
24 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
42 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
27 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
71 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
45 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
30 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
190 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
809 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
26 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
63 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
66 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
135 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), ...
3
votes
1answer
52 views

Terminal.app: changing shell behavior problem?

I'm having problems setting Terminal.app's default shell. It appears to work using a command line utility which sets the shell for the account, however not in Terminal.app's dialog which is for each ...
0
votes
1answer
225 views

Terminal won't find command of custom script since Catalina update

I have a very simple script to hide the icons from my desktop #!/usr/bin/env bash defaults write com.apple.finder CreateDesktop false killall Finder It is located in $USER/bin. Since the update, ...
1
vote
0answers
15 views

Bash-completion breaks hosts tab completion

Prior to installing Bash Completion, hitting the "tab" key after an "@" character would autocomplete hostnames listed in /etc/hosts. For example, if I started typing: drush @lo [tab] It would ...
0
votes
0answers
19 views

Retrieve old .bash_profile from hard drive using time machine [duplicate]

Apologies if this has already been asked, I searched through the prvious questions but to no avail. Last night, whilst trying to figure out how to open my bash profile through the terminal (its been ...
0
votes
1answer
45 views

Unable to edit .bash_profile file on mac [duplicate]

Unable to edit ~/.bash_profile file on my mac. I did some changes in this file and rebooted. From then nothing is working on my command line: Any help would be appreciated.
0
votes
1answer
27 views

Command works when run from alias but not when typed?

I use to type this command a lot : sshfs 10.xxx.xx.4:/Users/username/code mountpoint So one day i put it as an alias on my .bash_profile as alias sshfs='sshfs 10.xxx.xx.4:/Users/username/code ...
1
vote
0answers
53 views

Resetting /usr/bin

So I was installing python3, pip, and a few other applications through Homebrew when I first got my Mac. I realized I was doing all this in /usr/bin and not /usr/local/bin, and I wanted to just to ...
1
vote
1answer
258 views

I switched to Catalina and enabled ZSH now my home/end key do not work in terminal

I switched to ZSH from BASH as per the upgrade in Catalina and all is well except my home/end keys no longer work. This can be really annoying trying to move my cursor over super far to the left ...
0
votes
2answers
85 views

list files by date added in terminal with function or script or another

I found this in another post but would like to be able to call a script of function to reduce the amount of typing. ls -a | \ grep -v '^\.$\|^\.\.$' | \ xargs -I {} mdls -name kMDItemFSName -name ...
2
votes
1answer
42 views

Effects of changing shell

Recently Apple changed the default shell to zsh from bash. In the past I made significant changes to my .bashrc file. How should I incorporate those changes into the zsh terminal?
3
votes
1answer
615 views

Easiest way to migrate aliases from bash to zsh

I want to start using zsh as recommended by Apple for Mac OS Catalina. How do I migrate my aliases that I have defined in the ~/.bash_profile to the new shell?
0
votes
1answer
58 views

bash variable with spaces why cd “$myvar” results in one parameter, but myvar='“some stuff”' in two? [duplicate]

I'm struggling to understand why following does not work as expected in bash: $ myvar='"some stuff"' $ echo $myvar "some stuff" $ cd $myvar bash: cd: "some: No such file or directory I know the ...
1
vote
1answer
2k views

How do I remove the source (base) from my terminal?

I created some new aliases in my .bashrc file and did source ~/.bashrc Now, everytime I open my terminal it always comes with the (base) How do I remove that?
2
votes
2answers
137 views

grc inside terminal (with different colors into terminal as a function of files size) not working on 10.14.6 Mojave and working on High Sierra 10.13.6

I can get working the tool grc which allows to have colors for permissions and different colors as a function of the size of files listed for example with ls -l command. On my previous MacBook with ...