LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-22-2019, 06:29 AM   #1
DRAGSTER_TUNER
LQ Newbie
 
Registered: Apr 2009
Posts: 28

Rep: Reputation: 0
how to put it in the autostart?


Um using debian testing with xfce...

have to put this command in autostart:

export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/games"


i tried a script

#!/bin/bash
export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/games"


Butn i dunno if the script will works...and even if its ok, i doesnt know where i put it for the autostart works?

Anyone remember?
 
Old 01-22-2019, 07:42 AM   #2
dc.901
Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS 6-7; SuSE 8-12
Posts: 210

Rep: Reputation: 47
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.

Last edited by dc.901; 01-22-2019 at 07:50 AM.
 
1 members found this post helpful.
Old 01-22-2019, 11:42 AM   #3
ehartman
Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 375

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by DRAGSTER_TUNER View Post
#!/bin/bash
export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/games"


Butn i dunno if the script will works...
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.
 
Old 01-24-2019, 01:29 AM   #4
Brains
Member
 
Registered: Apr 2009
Distribution: Debian testing
Posts: 795

Rep: Reputation: 188Reputation: 188
Quote:
Originally Posted by DRAGSTER_TUNER View Post
export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/games"
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

Last edited by Brains; 01-24-2019 at 01:33 AM.
 
Old 01-25-2019, 06:23 AM   #5
DRAGSTER_TUNER
LQ Newbie
 
Registered: Apr 2009
Posts: 28

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dc.901 View Post
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.
Thanks for the tip, it works!

thanks to everyone whos posted another solutions!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Put each daily cron task in a separate script or put them all in one script? veeruk101 Linux - Newbie 4 10-19-2011 08:10 AM
KDE 4 Autostart Program Bash Script to Write Autostart Bash Scripts for You! jdmcdaniel3 SUSE / openSUSE 1 05-03-2010 07:17 AM
tomboy autostart in xfce, though not on autostart list zlya Linux - Desktop 2 11-10-2009 11:49 AM
Autostart for an Executable Raygun Linux - General 3 05-14-2001 07:28 AM
Kde 2 Autostart folder rfc1700 Linux - General 1 03-12-2001 09:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 03:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration