tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* trying to get a script to change directories....
@ 2001-04-18 19:00 George Gallen
  0 siblings, 0 replies; only message in thread
From: George Gallen @ 2001-04-18 19:00 UTC (permalink / raw)
  To: tru64-unix-managers

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: multipart/mixed; boundary="------_=_NextPart_001_01C0C839.E786DB20", Size: 3085 bytes --]

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C0C839.E786DB20
Content-Type: text/plain;
	charset="iso-8859-1"

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@slackinc.com
ph:856.848.1000 Ext 220

SLACK Incorporated - An innovative information, education and management
company
http://www.slackinc.com


------_=_NextPart_001_01C0C839.E786DB20
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>trying to get a script to change directories....</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2 FACE=3D"Arial">What I'm doing is I want to execute a =
script which will cd me</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">to the latest syslog files.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">I'm using the following:</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">cd /var/adm/syslog.dated/`ls -t =
/var/adm/syslog.dated | head -n 1` </FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">If I type it directly, it works, =
however if I run it as a script, I'm sure</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">the script pid changes directories, =
but when it ends, I'm back where</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">I was.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">How do I run the script without =
forking off a new PID?</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Thanks</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">George</FONT>
</P>
<BR>

<P><B><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Times New Roman">George =
Gallen</FONT></B>
<BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Times New Roman">Senior =
Programmer/Analyst</FONT>
<BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Times New =
Roman">Accounting/Data Division</FONT>
<BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Times New =
Roman">ggallen@slackinc.com</FONT>
<BR><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Times New =
Roman">ph:856.848.1000 Ext 220</FONT>
</P>

<P><B><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Times New Roman">SLACK =
Incorporated</FONT></B><FONT COLOR=3D"#800000" SIZE=3D2 FACE=3D"Times =
New Roman"> -<I> An innovative information, education and management =
company</I></FONT>
<BR><U><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Times New Roman"><A =
HREF=3D"http://www.slackinc.com" =
TARGET=3D"_blank">http://www.slackinc.com</A></FONT></U>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C0C839.E786DB20--

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-04-18 19:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-18 19:00 trying to get a script to change directories George Gallen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox