DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If goal is to set PATH, then that can be done without the script.
To set this path for all users, you can edit /etc/environment
To set this path for only you, you can edit ~/.profile
Once you set it, you can test by logging off, then log back in and in terminal check output of PATH variable.
No, it won't (to be exact: it will only work within the bash instance that is executing the script, and as that one exits after this line the change is gone again).
If in the SAME script you would execute some more commands, those would see the new PATH.
export exports variables to be used by commands, executed by that same (instance of the) shell, it doesn't export UPwards to the calling shell.
I sometimes wonder, if Debian maintainers are pushing people to just use sudo. But you can still enable a root account when installing Debian Testing, only problem is...
The /root/.bashrc file does not have any paths defined in a new intall. So the line quoted above needs to be added to the file /root/.bashrc, after that you will be able to execute commands from the root prompt.
Example of the file below:
Code:
# ~/.bashrc: executed by bash(1) for non-login shells.
# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
# umask 022
# You may uncomment the following lines if you want `ls' to be colorized:
# export LS_OPTIONS='--color=auto'
# eval "`dircolors`"
# alias ls='ls $LS_OPTIONS'
# alias ll='ls $LS_OPTIONS -l'
# alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'
export PATH=/sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
If you need this for a user, have a look at /home/user/.bashrc file for instructions
If goal is to set PATH, then that can be done without the script.
To set this path for all users, you can edit /etc/environment
To set this path for only you, you can edit ~/.profile
Once you set it, you can test by logging off, then log back in and in terminal check output of PATH variable.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.