Tag Info

New answers tagged

5

History expansion is done before alias expansion, so you'll have to use the history built-in to perform the expansion yourself: alias getit='sudo apt-get install $(history -p !!)' However, the above alias uses the whole last executed command as argument for sudo apt-get install, which means if we had given an argument to the failed command (like cowsay ...


0

When running from a launcher, the idea.sh script is started using a non-iteractive shell. In your .bashrc make sure the environment variables are exported before # If not running interactively, don't do anything case $- in *i*) ;; *) return;; esac Or alternatively place the environment variable exports in ~/.bash_profile


2

Neither of these suggestions may work for you, but here's what I would try first: Regarding the first issue, there's a hidden file in your home folder called .bashrc. Open a terminal and type ls -a which means "list files -all of them" and you should see the file. The contents of this file are executed every time you open your terminal, and I suspect that ...


0

From man bash: When bash is invoked as an interactive login shell, or as a non-inter‐ active shell with the --login option, it first reads and executes com‐ mands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands ...


2

Normally, .bashrc is only sourced for interactive shells, but many linux distributions decide to build bash with a special option to also source it for non-interactive shells if a SSH_something variable is in the environment. However, it doesn't switch the shell to interactive mode when doing this, so the following case command near the top of the default ...


3

The issue appears to be that the Python installer attempts to verify its changes to the .bashrc/.bash_profile files by spawning a shell and sourcing them. To do that, it uses the Python subprocess.Popen with shell=True, which defaults to using /bin/sh. On Ubuntu systems, /bin/sh is the dash shell rather than the bash shell (see DashAsBinSh), which doesn't ...



Top 50 recent answers are included