Skip to main content

All Questions

9 votes
1 answer
600 views

Why is bash startup executed under non-interactive ssh

I see an unexplained difference in behavior with ssh on Linux and FreeBSD, and it is the FreeBSD behavior that I would expect from the plain language of the manpages. So, something extra happens on ...
q.undertow's user avatar
0 votes
0 answers
106 views

What shell/env variable contains commandline suggestions?

Many years ago someone once showed me that if your shell returned a command suggestion then you could access it from a shell or environment variable. I thought this was very cool at the time but I ...
ojunk's user avatar
  • 113
0 votes
0 answers
231 views

What could cause the environment variables to not get loaded from ~/.bashrc at boot?

On one of my Debian11/KDE machines which uses X11, the environment variables don't get loaded from ~/.bashrc at boot and echo $PATH only prints very few (but not none!) variables. After booting I have ...
mYnDstrEAm's user avatar
  • 4,598
1 vote
1 answer
313 views

"sudo bash -s --" without changing $HOME?

I'd like to run a trusted script from the internet with the sudo command like so: sudo curl https://example.org/my-trusted-example.script.sh | sudo bash -s -- The script is using the $HOME variable. ...
Martin Braun's user avatar
1 vote
1 answer
635 views

Why not prepend user directory to PATH?

For user scripts, the usual advice is to append their directory to $PATH in one's .profile: PATH="$PATH:$HOME/.myscripts" # or .bin or whatever Apparently that is safer than prepending it: ...
Jortstek's user avatar
  • 273
0 votes
2 answers
7k views

How to store and print variables with special characters in shell/bash/sh/

I basically need to load, save and reload multiple times and in different forms a variable that contains arguments for a program. The problem is that this variable can't be treated as a usual variable ...
DATALOT's user avatar
  • 459
3 votes
3 answers
3k views

Is it safe to copy user's .bashrc to /root/.bashrc?

I am running Debian. The default /root/.bashrc is kinda empty. So if I do sudo -i to login as root, there are many things are not setup properly. Normally, I just do the following: $ sudo -i # mv ....
sgon00's user avatar
  • 447
-1 votes
1 answer
141 views

it does not work the creation of environment variable permanent using a script.sh in linux

I am using this script: #!/bin/bash case "$1" in start) echo "Iniciando servicio" export http_proxy=socks5://192.168.1.2:9090 export https_proxy <----I don't want it exported ...
ortiga's user avatar
  • 131
11 votes
1 answer
8k views

Can't export environment variables on X session start

My setup is: Debian testing (stretch), up to date LightDM with autologin enabled Awesome window manager bash, in ROXTerm or XTerm I don't seem to be able to set own environment variables and get it ...
Red's user avatar
  • 1,462
1 vote
1 answer
2k views

Using export USER=myName doesn't change the output of whoami

I saw this example $ whoami MatsP $ g++ -Wall -std=c++0x getenv.cpp $ ./a.out MatsP $ export USER=DonaldDuck $ ./a.out DonaldDuck but for me it doesn't work. I am in a Debian machine. I used export ...
traveller's user avatar
  • 111
0 votes
1 answer
126 views

When did bash quit exporting SHELL?

I upgraded a Debian box from stable to Jessie and I noticed that SHELL is no longer exported, so screen and similar programs start dash for subshells instead of bash. When was this change made and ...
hildred's user avatar
  • 5,859