Questions tagged [bash]

The Unix shell formerly used by Terminal in macOS until 10.15

Bash was the default shell in macOS until 2019 when it was depreciated in lieu of zsh in macOS 10.15 Catalina.

Bash is a command processor, which means that the user inputs text commands at a prompt. Like the majority of Unix shells, it supports filename wildcarding, piping, here documents, command substitution, variables and control structures for condition-testing and iteration. Almost all of the syntax was copied from the sh shell. The current major version of Bash is version 4.

1797 questions
59
votes
3 answers

How do I make find fail if -exec fails?

When I run this command in the shell (in a non-empty directory): find . -exec invalid_command_here {} \; I get this: find: invalid_command_here: No such file or directory find: invalid_command_here: No such file or directory find:…
39
votes
1 answer

How to install imgcat on iTerm2?

Question What do I do with the script? Please explain in plain English in step-by-step fashion. Background I saw that you can display images inline in iTerm2 But when I clicked on the link to Download imgcat here it just took me to a url that had…
JGallardo
  • 724
15
votes
1 answer

Find files modified today, using command line (bash)

As we all know, despite being named "Finder", the Finder is virtually useless at finding files. In Mac OS X 10.6 (or any version), how can I use the command line (bash in Terminal) to find files modified today?
Basil Bourque
  • 12,634
13
votes
1 answer

Is there a systemwide .bash_profile file?

The order of directories in my path is messed up, and I'm trying to correct it. Some of the path seems to be coming in from somewhere other than my user bash config files (I'm using both .bashrc and .bash_profile). Is there a system wide…
9
votes
1 answer

What is the __CHECKFIX1436934 environment variable?

On OS X 10.9.5 my bash shell has the following environment variable set: __CHECKFIX1436934=1 What is the purpose of this value? I am surprised there is no record of anybody asking this before.
7
votes
4 answers

How to list installed versions of the same program

I have a program called PyMOL installed multiple times on my machine. One was installed by MacPorts, one was installed through the developers distribution channel and so on. One is in /opt/local/bin, the other is in /i/have/no/clue. I know I can use…
TMOTTM
  • 191
6
votes
1 answer

How to test my installation script on macOS?

What is the best way to test an install script on macOS? I have written an installation script so that others can easily install the program qme-ng which I forked and am working on. However testing the script is very hard. I can manually uninstall…
Ying Zhou
  • 185
6
votes
1 answer

How can I reset my bash configuration?

When I open Terminal it shows this: Last login: Fri Apr 1 17:04:59 on ttys000 -bash: export: /opt/local/bin': not a valid identifier -bash: export::/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/local/bin:/usr/local/git/bin:/usr/X11/bin': not a…
5
votes
2 answers

How do I add a flag to an alias?

Is it possible to add a flag to a bash alias you create yourself? e.g. con -a = 'ssh [email protected]' con -b = 'ssh [email protected]'
5
votes
1 answer

`HISTSIZE=-1` causes 100% CPU on MacBook. Why does this happened?

I am setting up my first MacBook. I copied by .bash_aliases file from my Linux Mint. After that, I can not open Terminal with a bash session. I just see a black screen and bash taking 100% of my CPU. I found that the problem is HISTSIZE=-1 Why does…
4
votes
3 answers

How do I clear my Bash history in OS X?

How do I clear my Bash history in Mac OS X? I've entered a few "errors" and just want to clear them off. How do I do that?
marz679
  • 41
3
votes
1 answer

Upgrade or install Utility `stat`

I tried to install GNU utility stat $ brew install stat Error: No formulae found in taps. However,it succeeded to install GNU Bash How to achieve such a task?
Wizard
  • 2,589
3
votes
1 answer

Retrieve formatted manual page from command line

I try to export the manual page of grep to grep.txt $ man grep > ~/desktop/grep.txt It displayed in garbled code: GREP(1) BSD General Commands Manual GREP(1) NNAAMMEE …
Wizard
  • 2,589
2
votes
2 answers

Need a bit of help running a couple lines of bash in applescript. Maybe straight bash is best?

Preface this by saying I will be launching this script whether it be applescript or bash script with Alfred.app. Sorry to be so blunt and unknowledgable but I need to run a couple lines of bash in an applescript. I think a simple bash script is…
2
votes
3 answers

How can I change the default bash look?

My bash is white and black and I would like it to look much more colorful, how do I do that?
0x90
  • 171
1
2 3 4 5