At least I wasn't going crazy (well...I take that back).
Two options:
1. Create a symlink for current (I'm running an older OS that doesn't have
it)
2. use the "." command
so typing ". myscript" works
from Paul Sand, see the following URL:
<
http://www.faqs.org/faqs/unix-faq/faq/part2/section-8.html>
http://www.faqs.org/faqs/unix-faq/faq/part2/section-8.html
and from Alan Davis:
Newer versions of the OS include the "current" link. To simulate this in
older releases I modifed /sbin/init.d/syslog to do it for me :
case "$1" in'start')
set `who -r`
if [ $9 = "S" ]; then
if /usr/sbin/syslogd; then
echo "System error logger started"
rm /var/adm/syslog.dated/current
ln -s /var/adm/syslog.dated/`ls -ct /var/adm/syslog.dated | head -1`
/var/adm/syslog.dated/current
else
echo "Cannot start system error logger"
fi
fi
;;
Thanks to all who responded. Both the above methods are working.
George
-----Original Message-----
From: George Gallen [mailto:ggallen_at_slackinc.com]
Sent: Wednesday, April 18, 2001 3:01 PM
To: 'tru64-unix-managers_at_ornl.gov'
Subject: trying to get a script to change directories....
What I'm doing is I want to execute a script which will cd me
to the latest syslog files.
I'm using the following:
cd /var/adm/syslog.dated/`ls -t /var/adm/syslog.dated | head -n 1`
If I type it directly, it works, however if I run it as a script, I'm sure
the script pid changes directories, but when it ends, I'm back where
I was.
How do I run the script without forking off a new PID?
Thanks
George
George Gallen
Senior Programmer/Analyst
Accounting/Data Division
ggallen_at_slackinc.com
ph:856.848.1000 Ext 220
SLACK Incorporated - An innovative information, education and management
company
http://www.slackinc.com <
http://www.slackinc.com>
Received on Wed Apr 18 2001 - 19:29:31 NZST