Trap, ERR, and echoing the error line
I’m trying to create some error reporting using a Trap to call a function on all errors:
I’m trying to create some error reporting using a Trap to call a function on all errors:
How can I show spinner till command line finish it is job? In other words, If I am running a script and I want to show spinner while this script is running and the spinner disappears when the script finish it is job.
I understand what brace expansion is, but I don’t know how best to use it.
I am doing integer comparison in bash (trying to see if the user is running as root), and I found two different ways of doing it:
Is there a shortcut in bash and zsh to delete one component of a path? For example, if I type ls ~/local/color/, and the cursor is at the end of line, is there a shortcut to delete the color/ at the end? Ideally I want solutions in both vi-mode and emacs-mode
When I use the following, I get a result as expected:
I want to take down data in /path/to/data/folder/month/date/hour/minute/file and symlink it to /path/to/recent/file and do this automatically every time a file is created.
I like to keep my bash_profile in a git repository and clone it to whatever machines I have shell access to. Since I’m in tmux most of the time I have a [email protected] string in the status line, rather than its traditional spot in the shell prompt.
I’ve got 10k+ files totaling over 20GB that I need to concatenate into one file.
How could I execute a script in Shell when a shortcut key is pressed.