Code: Select all
PATH=/share/homes/admin/bin:$PATH
I can then run my scripts that are stored there, but after a while it no longer works and I have to run the command again. The system has not even rebooted. Any thoughts?
Thanks
Code: Select all
PATH=/share/homes/admin/bin:$PATH
Phifer wrote:I use the following to add a directory to my pathCode: Select all
PATH=/share/homes/admin/bin:$PATH
I can then run my scripts that are stored there, but after a while it no longer works and I have to run the command again. The system has not even rebooted. Any thoughts?
Thanks
Code: Select all
export PATH=/share/homes/admin/bin:$PATH
pwilson wrote:
Try this instead:Code: Select all
export PATH=/share/homes/admin/bin:$PATH
- Do you have Optware installed?
- Are you using the QNAP or OpenSSH version of SSHd?
If you are using the OpenSSH server, then you can add this line to your .profile, .bash_profile or .bashrc. If you are still using the QNAP provided one, then you can simply change the $PATH in the /etc/profile instead. See the Fix the $PATH in /etc/profile section of QNAPedia article: Install Optware IPKG.
I hope this information proves useful to you.
Code: Select all
/share/homes/admin/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local/sbin:/usr/local/bin:/opt/bin:/opt/sbin:/usr/local/jre/bin:/Apps/bin:/Apps/sbin
export PATH=/share/homes/admin/bin:$PATH
Code: Select all
# ~/.bashrc: executed by bash(1) for non-login interactive shells.
export PATH=\
/bin:\
/sbin:\
/usr/bin:\
/usr/sbin:\
/usr/bin/X11:\
/usr/local/sbin
# If running interactively, then:
if [ "$PS1" ]; then
if [ "$BASH" ]; then
export PS1="[\u@\h \W]\\$ "
alias ll='/bin/ls -laFh'
alias ls='/bin/ls -F'
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;$
else
if [ "`id -u`" -eq 0 ]; then
export PS1='# '
else
export PS1='$ '
fi
fi
export USER=`id -un`
Phifer wrote:I use the following to add a directory to my pathCode: Select all
PATH=/share/homes/admin/bin:$PATH
I can then run my scripts that are stored there, but after a while it no longer works and I have to run the command again. The system has not even rebooted. Any thoughts?
Thanks
Code: Select all
echo $PATH
Phifer wrote:I followed the instructions and /opt/bin and opt/sbin are both in the begenning of my PATH even after a restart.
Code: Select all
export PATH=/share/homes/admin/bin:$PATH
Phifer wrote:Phifer wrote:I followed the instructions and /opt/bin and opt/sbin are both in the begenning of my PATH even after a restart.
I have followed the section: Fix the $PATH in /etc/profile
But my path does not stay after a reboot usingCode: Select all
export PATH=/share/homes/admin/bin:$PATH
So do I need to use my editor (nano) and add it to the profile that way?
Phifer wrote:
So do I need to use my editor (nano) and add it to the profile that way?
Phifer wrote:Phifer wrote:
So do I need to use my editor (nano) and add it to the profile that way?
I cannot seem to get a yes or no. I have only used the export command. I have not gone through and changed the /etc/profile using my editor in fear of messing something up.
When I use the export PATH=... it does not end up in the /etc/profile
Honestly I have no idea where it does. I know it shows up with echo $PATH until I reboot.
Thank you for your help and patience with the new guy.
Fix the $PATH in /etc/profile section of QNAPedia article: Install Optware IPKG wrote: Fix the $PATH in /etc/profile
The code that sets up the Optware environment should extend the $PATH environment variable, adding the Optware bin directories to the head of the path where they can preempt any equivalents that come with the QNAP firmware. It should also preserve the original path, with any modifications which other software made. As of April 2010, TS-219P Firmware 3.2.5 build 0409T does not do this correctly.
Edit the file:Code: Select all
vi /etc/init.d/Optware.sh
Look for the section of code which mentions /opt/bin. Replace it so that this part of the file looks like:Code: Select all
# adding Ipkg apps into system path ...
/bin/cat /etc/profile | /bin/grep "PATH" | /bin/grep "/opt/bin" 1>>/dev/null 2>>/dev/null
# Bug fix for following: put IPKG first, per http://forum.qnap.com/viewtopic.php?f=124&t=15663
# was [ $? -ne 0 ] && /bin/echo "export PATH=$PATH":/opt/bin:/opt/sbin >> /etc/profile
[ $? -ne 0 ] && /bin/echo "export PATH=/opt/bin:/opt/sbin:\$PATH" >> /etc/profile
Save the file and quit the editor.
Code: Select all
/opt/bin/nano /etc/init.d/Optware.sh
Code: Select all
# adding Ipkg apps into system path ...
/bin/cat /etc/profile | /bin/grep "PATH" | /bin/grep "/opt/bin" 1>>/dev/null 2>>/dev/null
# Bug fix for following: put IPKG first, per http://forum.qnap.com/viewtopic.php?f=124&t=15663
# was [ $? -ne 0 ] && /bin/echo "export PATH=$PATH":/opt/bin:/opt/sbin >> /etc/profile
[ $? -ne 0 ] && /bin/echo "export PATH=/share/homes/admin/bin:/opt/bin:/opt/sbin:\$PATH" >> /etc/profile
Phifer wrote:This last post got away from what I am trying to do. I have already done the "Fix the $PATH in /etc/profile"
I am trying to keep my directory in the PATH... /share/homes/admin/bin
This is where I keep my custom scripts.
I have now edited "/etc/profile" and added "/share/homes/admin/bin" to the beginning.
echo $PATH did not show my directory before a reboot or after
Phifer wrote:Ok.
That is what I was missing was the RAMDisk. Any changes made will be lost. I am now picking up what you were trying to get across. Thanks