Re: Beginner's?? Question

2004-11-22 Thread icebiker

Thanks. That indeed does it. Did not know how to use tail here.
Now, how do I use it in a script, such as
$LASTFILE =  ?
do something using $LASTFILE
 

LASTFILE=`ls -ltr | tail -1`
where ` is the backward quote (on the ~ (tilde) key on my north american 
keyboard).

/icebiker
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Beginner's?? Question

2004-11-22 Thread Roel Schroeven
David Baron wrote:
On Monday 22 November 2004 13:30, [EMAIL PROTECTED] 
wrote:

ls -ltr
This gives a listing of files in the current dir with the most
recently altered one last. To get only the name of that last one use:
ls -tr | tail -1

Thanks. That indeed does it. Did not know how to use tail here.
Now, how do I use it in a script, such as
$LASTFILE =  ?
LASTFILE=$(ls -tr | tail -1)
--
"Codito ergo sum"
Roel Schroeven
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Beginner's?? Question

2004-11-22 Thread David Baron
On Monday 22 November 2004 13:30, [EMAIL PROTECTED] 
wrote:
> ls -ltr
>
> This gives a listing of files in the current dir with the most
> recently altered one last. To get only the name of that last one use:
>
> ls -tr | tail -1

Thanks. That indeed does it. Did not know how to use tail here.
Now, how do I use it in a script, such as
$LASTFILE =  ?
do something using $LASTFILE


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Beginner's?? Question

2004-11-22 Thread Maurits van Rees
On Mon, Nov 22, 2004 at 12:07:34PM +0200, David Baron wrote:
> All this gets me the current or previously accessed directory.  I am
> trying to get the most recent file in a known directory. There are
> several log-type files in this directory, maybe several from
> today. I want to use the last-most recently altered file's name in a
> script.

Try this:

ls -ltr

This gives a listing of files in the current dir with the most
recently altered one last. To get only the name of that last one use:

ls -tr | tail -1


-- 
Maurits van Rees | http://maurits.vanrees.org/ [Dutch/Nederlands]
"Let your advance worrying become advance thinking and planning."
 - Winston Churchill


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Beginner's?? Question

2004-11-22 Thread David Baron
On Sunday 21 November 2004 23:51, [EMAIL PROTECTED] 
wrote:
> > David Baron wrote:
> > > Quick answer: How might one retrieve the path to the most recent entry
> > > in a directory to pass to something else in a bash script?
> >
> > [EMAIL PROTECTED]:/tmp$ echo $OLDPWD
> > /home/kspecial
> > [EMAIL PROTECTED]:/tmp$ echo $PWD
> > /tmp
> > [EMAIL PROTECTED]:/tmp$
> >
> > PWD contains the current directory while OLDPWD contains the last
> > accessed directory.
> >
> > --K-sPecial
>
> Just maybe you could use
> $ cd -
>
> It worked for me

All this gets me the current or previously accessed directory.
I am trying to get the most recent file in a known directory. There are 
several log-type files in this directory, maybe several from today. I want to 
use the last-most recently altered file's name in a script.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Beginner's?? Question

2004-11-21 Thread David Raleigh Arnold
On Sunday 21 November 2004 10:34 am, K-sPecial wrote:
> David Baron wrote:
> > Quick answer: How might one retrieve the path to the most recent entry in
> > a directory to pass to something else in a bash script?
>
> [EMAIL PROTECTED]:/tmp$ echo $OLDPWD
> /home/kspecial
> [EMAIL PROTECTED]:/tmp$ echo $PWD
> /tmp
> [EMAIL PROTECTED]:/tmp$
>
> PWD contains the current directory while OLDPWD contains the last
> accessed directory.
>
> --K-sPecial

Just maybe you could use
$ cd -

It worked for me.  daveA


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Beginner's?? Question

2004-11-21 Thread K-sPecial
David Baron wrote:
Quick answer: How might one retrieve the path to the most recent entry in a 
directory to pass to something else in a bash script?



[EMAIL PROTECTED]:/tmp$ echo $OLDPWD
/home/kspecial
[EMAIL PROTECTED]:/tmp$ echo $PWD
/tmp
[EMAIL PROTECTED]:/tmp$
PWD contains the current directory while OLDPWD contains the last 
accessed directory.

--K-sPecial
[ http://xzziroz.freeshell.org
  irc://xzziroz.dtdns.net   ]

--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: = = = Beginner's Question = = = =

2000-01-31 Thread Eric Gillespie, Jr.
On Mon, Jan 31, 2000 at 10:51:14AM -0500,
Lim, Sang-Bin <[EMAIL PROTECTED]> wrote:
>  gcc  mypgm.c
> 
>  problem is :
> 
>  bash: stdio.h : not found  error message 

Well, it's hard to tell without posting mypgm.c, but I'm guessing that
you put stdio.h in quotes ("stdio.h"), when it should have been in
greater-than/less-than brackets ().

> %PATH does not include /usr/include now.

Nor should it.

-- 
Eric Gillespie, Jr. <*> [EMAIL PROTECTED]

All hail the Dollar, King of the Earth.


pgp6UxzWUFt84.pgp
Description: PGP signature


Re: Beginner's Question

1997-02-18 Thread Erik Johansson
On 10-Feb-97, Philippe Troin wrote:

>On Mon, 10 Feb 1997 13:37:10 PST Colin Watt ([EMAIL PROTECTED]) 
>wrote:


>> I have download the Debian files and created my disks and loaded Debian
>>Linux on a stand alone PC.
>> All is well - but what next?

This is a question I have asked myself many times... I don't want to buy a CD
to install Debian and I don't want to stay connected to my ISP either.

>I guess you've just installed the base disks.
>Now, you need to install supplemental packages using dselect.
>If you have a CD-ROM, this will be straightforward.
>Otherwise, you'll have to configure ppp or your ethernet card to get net
>access, and install with the ftp option of dselect.

Well it's time for me to ask this question. How does Dselects' ftp mode work,
can I select which packages to install, and then get a list of files to
download from a Debian FTP mirror? I'm a person who has got  the bad habit of
RTFM (gasp), but the problem is that I can't find anything about *what*
exactly all the modes  does..  

-- 
Erik Johansson, one of those sloppy students
A big QNX, Linux/x86/m68k Amiga and BeOS fan


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED]