Code: Select all
PATH=/share/homes/admin/bin:$PATH
Thanks
Code: Select all
PATH=/share/homes/admin/bin:$PATH
Try this instead:Phifer wrote:I use the following to add a directory to my 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?Code: Select all
PATH=/share/homes/admin/bin:$PATH
Thanks
Code: Select all
export PATH=/share/homes/admin/bin:$PATH
This code worked. I also ran echo $PATH and the results werepwilson 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
But after restart the path was cleared again.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`
Please review the Fix the $PATH in /etc/profile section of QNAPedia article: Install Optware IPKG.Phifer wrote:I use the following to add a directory to my 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?Code: Select all
PATH=/share/homes/admin/bin:$PATH
Thanks
Code: Select all
echo $PATH
I have followed the section: Fix the $PATH in /etc/profilePhifer 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
If it isn't staying then something else is changing it. You'll need to do some troubleshooting to figure out what is changing it. /etc/profile is the first thing run after login, so this does set it. If it is being "unset" by something else, then you'll need to figure out what is changing it.Phifer wrote:I have followed the section: Fix the $PATH in /etc/profilePhifer wrote:I followed the instructions and /opt/bin and opt/sbin are both in the begenning of my PATH even after a restart.
But my path does not stay after a reboot usingSo do I need to use my editor (nano) and add it to the profile that way?Code: Select all
export PATH=/share/homes/admin/bin:$PATH
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.Phifer wrote:
So do I need to use my editor (nano) and add it to the profile that way?
Phifer wrote: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.Phifer wrote:
So do I need to use my editor (nano) and add it to the profile that way?
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.
You can use "nano" instead of "vi" if you feel so inclined.Fix the $PATH in /etc/profile[/url] section of [url=http://wiki.qnap.com/wiki/]QNAPedia[/url] article: [url=http://wiki.qnap.com/wiki/Install_Optware_IPKG]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:
Look for the section of code which mentions /opt/bin. Replace it so that this part of the file looks like:Code: Select all
vi /etc/init.d/Optware.sh
Save the file and quit the editor.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
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
We're going in circles here. /etc/profile is part of the RAMDisk. It therefore needs to be modified at every boot, this why you change it via the "Optware.sh" file, as clearly shown in my last message in this thread.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
If you need further assistance please feel free to ask more questions. I apologize that I was so ineffective at conveying this information sooner. Thank-you for your feedback. I appreciate it. Please me know how you make out.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