Why does bash set $? (exit status) to non-zero on Ctrl-C or Ctrl-Z?
From the bash manual, on the $? variable:
From the bash manual, on the $? variable:
Sometimes when I want to logout quickly I do kill -15 -1. I’ve noticed that bash is ignoring SIGTERM.
I know that VARIABLE=value creates an environment variable, and export VARIABLE=value makes it available to processes created by the current shell. env shows the current environment variables, but where do they live? What comprises an environment variable (or an environment, for that matter)?
I started learning Bash a couple of days ago.
One of my favorite Unix tricks is ^x^y, which will take the last command and replace the first instance of “x” with “y”. However, I’m wondering if a similar trick works to replace all instances of “x” with “y” in the last command?
I am trying to automate these steps so that I don’t need to do this on every machines manually. I need to install latest app server software (abc.tar.gz) on all the unix boxes.
I am writing a bash script that needs to know which desktop environment (XFCE, Unity, KDE, LXDE, Mate, Cinnamon, GNOME2, GNOME3,… ) is running.
Suppose you have an alias go, but want it to do different things in different directories?
I often want to feed relatively short string data (could be several lines though) to commandline programs which accept only input from files (e.g. wdiff) in a repeated fashion. Sure I can create one or more temporary files, save the string there and run the command with the file name as parameter. But it looks to me as if this procedure would be highly inefficient if data is actually written to the disk and also it could harm the disk more than necessary if I repeat this procedure many times, e.g. if I want to feed single lines of long text files to wdiff. Is there a recommended way to circumvent this, say by using pseudo files such as pipes to store the data temporarily without actually writing it to the disk (or writing it only if it exceeds a critical length). Note that wdiff takes two arguments and, as far as I understand it will not be possible to feed the data doing something like wdiff <"text".