Re: New tests for test(1)

1999-08-13 Thread Sheldon Hearn



On Thu, 12 Aug 1999 11:41:31 -0400, "Brian F. Feldman" wrote:

  NetBSD's test(1) utility has this (-nt and -ot). We should probably
  merge in their changes.
 
 Hmm... this is in pdksh too...

Don't go there. :-)

Ciao,
Sheldon.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-13 Thread Sheldon Hearn



On Fri, 13 Aug 1999 15:36:24 +1000, Peter Jeremy wrote:

 It would be nice, but there are portability issues.

Hi Peter,

I'm only replying to your mail because you're the last person to mention
portability as a case againsdt NetBSD's test(1).

Just how many other platforms need to support an _extension_ that is
_fully_ backward compatible before we'll consider implementing it?

With this attitude driving us, we'll end up being the only OS that
doesn't support a number of fetures, all in the name of portability. :-)

Ciao,
Sheldon.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-13 Thread Brian F. Feldman

On Fri, 13 Aug 1999, Sheldon Hearn wrote:

 
 
 On Fri, 13 Aug 1999 15:36:24 +1000, Peter Jeremy wrote:
 
  It would be nice, but there are portability issues.
 
 Hi Peter,
 
 I'm only replying to your mail because you're the last person to mention
 portability as a case againsdt NetBSD's test(1).
 
 Just how many other platforms need to support an _extension_ that is
 _fully_ backward compatible before we'll consider implementing it?
 
 With this attitude driving us, we'll end up being the only OS that
 doesn't support a number of fetures, all in the name of portability. :-)

I fully agree with this. If it can be cleanly added to the current test(1)
(which it can), we should have it, even if it were JUST for the sake of
portability. I don't see why we shouldn't add it. I mean, /bin/sh is
already a bastardized shell that's partway to ksh, so we could at least
support more features than we do now :)

 
 Ciao,
 Sheldon.
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with "unsubscribe freebsd-hackers" in the body of the message
 

 Brian Fundakowski Feldman  _ __ ___   ___ ___ ___  
 [EMAIL PROTECTED]   _ __ ___ | _ ) __|   \ 
 FreeBSD: The Power to Serve!_ __ | _ \._ \ |) |
   http://www.FreeBSD.org/  _ |___/___/___/ 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-13 Thread Sheldon Hearn



On Fri, 13 Aug 1999 12:50:54 -0400, "Brian F. Feldman" wrote:

 I fully agree with this. If it can be cleanly added to the current test(1)
 (which it can), we should have it, even if it were JUST for the sake of
 portability.

Ah, but I'm not proposing that we add new functionality to the existing
test(1). The code gave me a head-ache. I'm proposing that we replace our
test(1) entirely.

Ciao,
Sheldon.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-13 Thread Brian F. Feldman

On Fri, 13 Aug 1999, Sheldon Hearn wrote:

 
 
 On Fri, 13 Aug 1999 12:50:54 -0400, "Brian F. Feldman" wrote:
 
  I fully agree with this. If it can be cleanly added to the current test(1)
  (which it can), we should have it, even if it were JUST for the sake of
  portability.
 
 Ah, but I'm not proposing that we add new functionality to the existing
 test(1). The code gave me a head-ache. I'm proposing that we replace our
 test(1) entirely.
 
 Ciao,
 Sheldon.
 

I don't see how our test is that bad. It's doing something right if the
functionality is so easy to add...

 Brian Fundakowski Feldman  _ __ ___   ___ ___ ___  
 [EMAIL PROTECTED]   _ __ ___ | _ ) __|   \ 
 FreeBSD: The Power to Serve!_ __ | _ \._ \ |) |
   http://www.FreeBSD.org/  _ |___/___/___/ 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-13 Thread Sheldon Hearn


On Thu, 12 Aug 1999 11:41:31 -0400, Brian F. Feldman wrote:

  NetBSD's test(1) utility has this (-nt and -ot). We should probably
  merge in their changes.
 
 Hmm... this is in pdksh too...

Don't go there. :-)

Ciao,
Sheldon.


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-13 Thread Sheldon Hearn


On Fri, 13 Aug 1999 15:36:24 +1000, Peter Jeremy wrote:

 It would be nice, but there are portability issues.

Hi Peter,

I'm only replying to your mail because you're the last person to mention
portability as a case againsdt NetBSD's test(1).

Just how many other platforms need to support an _extension_ that is
_fully_ backward compatible before we'll consider implementing it?

With this attitude driving us, we'll end up being the only OS that
doesn't support a number of fetures, all in the name of portability. :-)

Ciao,
Sheldon.


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-13 Thread Sheldon Hearn

Hi folks,

The pdksh-derived test(1) used by NetBSD and OpenBSD has made it through
a ``make world'' and package run on my box. It passes the regression
tests supplied with our own test(1) in exactly the same way as our own
test(1) does, and shows no noticeable performance difference.

I've mentioned several times that portability is a non-issue here
and haven't heard any rebuttals. I have a PR open (PR 13091) for
replacing our test(1) with the one used by {Net,Open}BSD. The
PR contains a diff which you should ignore. Rather look at
http://www.freebsd.org/~sheldonh/test/ :-)

So are there any reasonable ojections to our following the lead of our
sister free-BSD's?

Ciao,
Sheldon.


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-13 Thread Brian F. Feldman
On Fri, 13 Aug 1999, Sheldon Hearn wrote:

 
 
 On Fri, 13 Aug 1999 15:36:24 +1000, Peter Jeremy wrote:
 
  It would be nice, but there are portability issues.
 
 Hi Peter,
 
 I'm only replying to your mail because you're the last person to mention
 portability as a case againsdt NetBSD's test(1).
 
 Just how many other platforms need to support an _extension_ that is
 _fully_ backward compatible before we'll consider implementing it?
 
 With this attitude driving us, we'll end up being the only OS that
 doesn't support a number of fetures, all in the name of portability. :-)

I fully agree with this. If it can be cleanly added to the current test(1)
(which it can), we should have it, even if it were JUST for the sake of
portability. I don't see why we shouldn't add it. I mean, /bin/sh is
already a bastardized shell that's partway to ksh, so we could at least
support more features than we do now :)

 
 Ciao,
 Sheldon.
 
 
 To Unsubscribe: send mail to majord...@freebsd.org
 with unsubscribe freebsd-hackers in the body of the message
 

 Brian Fundakowski Feldman  _ __ ___   ___ ___ ___  
 gr...@freebsd.org   _ __ ___ | _ ) __|   \ 
 FreeBSD: The Power to Serve!_ __ | _ \._ \ |) |
   http://www.FreeBSD.org/  _ |___/___/___/ 



To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-13 Thread Sheldon Hearn


On Fri, 13 Aug 1999 12:50:54 -0400, Brian F. Feldman wrote:

 I fully agree with this. If it can be cleanly added to the current test(1)
 (which it can), we should have it, even if it were JUST for the sake of
 portability.

Ah, but I'm not proposing that we add new functionality to the existing
test(1). The code gave me a head-ache. I'm proposing that we replace our
test(1) entirely.

Ciao,
Sheldon.


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-13 Thread Brian F. Feldman
On Fri, 13 Aug 1999, Sheldon Hearn wrote:

 
 
 On Fri, 13 Aug 1999 12:50:54 -0400, Brian F. Feldman wrote:
 
  I fully agree with this. If it can be cleanly added to the current test(1)
  (which it can), we should have it, even if it were JUST for the sake of
  portability.
 
 Ah, but I'm not proposing that we add new functionality to the existing
 test(1). The code gave me a head-ache. I'm proposing that we replace our
 test(1) entirely.
 
 Ciao,
 Sheldon.
 

I don't see how our test is that bad. It's doing something right if the
functionality is so easy to add...

 Brian Fundakowski Feldman  _ __ ___   ___ ___ ___  
 gr...@freebsd.org   _ __ ___ | _ ) __|   \ 
 FreeBSD: The Power to Serve!_ __ | _ \._ \ |) |
   http://www.FreeBSD.org/  _ |___/___/___/ 



To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Nadav Eiron



On Thu, 12 Aug 1999, Graham Wheeler wrote:

 Hi all
 
 I was writing a script yesterday, and I wanted to have a test to compare
 the modification time of two files. test(1) doesn't have the ability to
 do this. In the end I worked around this by using make(1), but it set me
 thinking - wouldn't it be a good idea to add some new tests to test(1),
 to compare files based on criteria like size or modification date?

A suggestion for another way to implement such a test:
ls -1t file1 file2 | head -1
will give you the newest of the two... That's what I use when I need to do
such tests. I guess it's easier and faster than make.

 
 Anyone else think this is a good idea?
 
 -- 
 Dr Graham WheelerE-mail: [EMAIL PROTECTED]
 Cequrux Technologies   Phone:  +27(21)423-6065/6/7
 Firewalls/Virtual Private Networks   Fax:+27(21)24-3656
 Data/Network Security SpecialistsWWW:http://www.cequrux.com/
 
 

Nadav



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Dag-Erling Smorgrav

Graham Wheeler [EMAIL PROTECTED] writes:
 I was writing a script yesterday, and I wanted to have a test to compare
 the modification time of two files. test(1) doesn't have the ability to
 do this. In the end I worked around this by using make(1), but it set me
 thinking - wouldn't it be a good idea to add some new tests to test(1),
 to compare files based on criteria like size or modification date?

NetBSD's test(1) utility has this (-nt and -ot). We should probably
merge in their changes.

DES
-- 
Dag-Erling Smorgrav - [EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Sheldon Hearn



On 12 Aug 1999 11:42:42 +0200, Dag-Erling Smorgrav wrote:

 NetBSD's test(1) utility has this (-nt and -ot). We should probably
 merge in their changes.

Their code isn't useful in this case, since they've merged in a
pdksh-derived version of test. How about we do the same? :-)

Ciao,
Sheldon.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Aaron Smith

this seems undesirable to me, since using it immediately makes your shell
scripts nonportable. i liked the ls -t suggestion though.

--
Aaron Smith
[EMAIL PROTECTED]

On Thu, Aug 12, 1999 at 11:18:50AM +0200, Graham Wheeler wrote:
 thinking - wouldn't it be a good idea to add some new tests to test(1),
 to compare files based on criteria like size or modification date?
 
 Anyone else think this is a good idea?


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Graham Wheeler

Aaron Smith wrote:
 
 this seems undesirable to me, since using it immediately makes your shell
 scripts nonportable. i liked the ls -t suggestion though.

Portability is a Good Thing, but I write a lot of one-off scripts
in which portability isn't an issue. Also, just because one uses
standard shell commands is no guarantee of portability, as a shell
script can invoke arbitrary programs, which may or may not be present 
or compatible across different hosts.

-- 
Dr Graham WheelerE-mail: [EMAIL PROTECTED]
Cequrux Technologies Phone:  +27(21)423-6065/6/7
Firewalls/Virtual Private Networks   Fax:+27(21)24-3656
Data/Network Security SpecialistsWWW:http://www.cequrux.com/


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Bob Bishop

Hi,

At 4:01 am -0700 12/8/99, Aaron Smith wrote:
this seems undesirable to me, since using it immediately makes your shell
scripts nonportable. i liked the ls -t suggestion though.

Further, isn't test a builtin for most (all?) shells? Sounds like a can of
worms to me...


On Thu, Aug 12, 1999 at 11:18:50AM +0200, Graham Wheeler wrote:
 thinking - wouldn't it be a good idea to add some new tests to test(1),
 to compare files based on criteria like size or modification date?

 Anyone else think this is a good idea?



--
Bob Bishop  (0118) 977 4017  international code +44 118
[EMAIL PROTECTED]fax (0118) 989 4254  between 0800 and 1800 UK




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Sheldon Hearn



On Thu, 12 Aug 1999 12:26:41 GMT, Bob Bishop wrote:

 Further, isn't test a builtin for most (all?) shells? Sounds like a can of
 worms to me...

If your only motivation for saying it's a can of worms is that test is
usually a builtin, don't sweat it. Lots of scripts insist on using
/bin/test .

Ciao,
Sheldon.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Sheldon Hearn



On Thu, 12 Aug 1999 12:22:39 +0200, Sheldon Hearn wrote:

 Their code isn't useful in this case, since they've merged in a
 pdksh-derived version of test. How about we do the same? :-)

By the way, OpenBSD have _also_ incorporated NetBSD's test. *evil.grin*

Ciao,
Sheldon.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Martin Cracauer

  thinking - wouldn't it be a good idea to add some new tests to test(1),
  to compare files based on criteria like size or modification date?

So far it has been policy for FreeBSD not to add options to
commandline utilities that are replaceable by simple shell script
constructs. Especially if that other construct is POSIX-compliant.

Examples:
- An option to date(1), which would print the machine's idea of the
  time, no matter what $TZ is set it. Easily replaceable by 
  (unset  TZ; date)
- An option to a tool that puts out a single line of text to stdout.
  The option would make it print its line without the final newline.
  Easily replaceable by backquotes
  echo `thistool`

Clearly, the functionality discussed falls into this category.

ls -t and head are specified in POSIX, thus it isn't affected by the
usualy shell script unportability like another poster implied.

 this seems undesirable to me, since using it immediately makes your shell
 scripts nonportable. i liked the ls -t suggestion though.
 
 Further, isn't test a builtin for most (all?) shells? Sounds like a can of
 worms to me...

FreeBSD's /bin/sh uses the external /bin/test. Most other shells in
common use have it built in. You are right that this would confuse
people no end since most couldn't use the same test(1) arguments in
theirs scripts and interactivly.

In a word, I'm against it. Whatever you want this for, it's the far
better solution to have your own test(1)-like utility in your personal
search path.

Martin
-- 
%
Martin Cracauer [EMAIL PROTECTED] http://www.cons.org/cracauer/
BSD User Group Hamburg, Germany http://www.bsdhh.org/


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Brian F. Feldman

On Thu, 12 Aug 1999, Brian F. Feldman wrote:

 On 12 Aug 1999, Dag-Erling Smorgrav wrote:
 
  Graham Wheeler [EMAIL PROTECTED] writes:
   I was writing a script yesterday, and I wanted to have a test to compare
   the modification time of two files. test(1) doesn't have the ability to
   do this. In the end I worked around this by using make(1), but it set me
   thinking - wouldn't it be a good idea to add some new tests to test(1),
   to compare files based on criteria like size or modification date?
  
  NetBSD's test(1) utility has this (-nt and -ot). We should probably
  merge in their changes.
 
 Hmm... this is in pdksh too...

In other words, I think we've come upon more reasons to switch.

 
  
  DES
  -- 
  Dag-Erling Smorgrav - [EMAIL PROTECTED]
  
 
  Brian Fundakowski Feldman  _ __ ___   ___ ___ ___  
  [EMAIL PROTECTED]   _ __ ___ | _ ) __|   \ 
  FreeBSD: The Power to Serve!_ __ | _ \._ \ |) |
http://www.FreeBSD.org/  _ |___/___/___/ 
 
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with "unsubscribe freebsd-hackers" in the body of the message
 

 Brian Fundakowski Feldman  _ __ ___   ___ ___ ___  
 [EMAIL PROTECTED]   _ __ ___ | _ ) __|   \ 
 FreeBSD: The Power to Serve!_ __ | _ \._ \ |) |
   http://www.FreeBSD.org/  _ |___/___/___/ 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Peter Jeremy

I was writing a script yesterday, and I wanted to have a test to compare
the modification time of two files.

I've written programs to do this before as well.  A more portable
approach is
find file1 -newer file2 ...

thinking - wouldn't it be a good idea to add some new tests to test(1),
to compare files based on criteria like size or modification date?

Anyone else think this is a good idea?

It would be nice, but there are portability issues.

Peter


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Nadav Eiron


On Thu, 12 Aug 1999, Graham Wheeler wrote:

 Hi all
 
 I was writing a script yesterday, and I wanted to have a test to compare
 the modification time of two files. test(1) doesn't have the ability to
 do this. In the end I worked around this by using make(1), but it set me
 thinking - wouldn't it be a good idea to add some new tests to test(1),
 to compare files based on criteria like size or modification date?

A suggestion for another way to implement such a test:
ls -1t file1 file2 | head -1
will give you the newest of the two... That's what I use when I need to do
such tests. I guess it's easier and faster than make.

 
 Anyone else think this is a good idea?
 
 -- 
 Dr Graham WheelerE-mail: g...@cequrux.com
 Cequrux Technologies   Phone:  +27(21)423-6065/6/7
 Firewalls/Virtual Private Networks   Fax:+27(21)24-3656
 Data/Network Security SpecialistsWWW:http://www.cequrux.com/
 
 

Nadav



To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Dag-Erling Smorgrav
Graham Wheeler g...@cequrux.com writes:
 I was writing a script yesterday, and I wanted to have a test to compare
 the modification time of two files. test(1) doesn't have the ability to
 do this. In the end I worked around this by using make(1), but it set me
 thinking - wouldn't it be a good idea to add some new tests to test(1),
 to compare files based on criteria like size or modification date?

NetBSD's test(1) utility has this (-nt and -ot). We should probably
merge in their changes.

DES
-- 
Dag-Erling Smorgrav - d...@flood.ping.uio.no


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Sheldon Hearn


On 12 Aug 1999 11:42:42 +0200, Dag-Erling Smorgrav wrote:

 NetBSD's test(1) utility has this (-nt and -ot). We should probably
 merge in their changes.

Their code isn't useful in this case, since they've merged in a
pdksh-derived version of test. How about we do the same? :-)

Ciao,
Sheldon.


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Aaron Smith
this seems undesirable to me, since using it immediately makes your shell
scripts nonportable. i liked the ls -t suggestion though.

--
Aaron Smith
aa...@mutex.org

On Thu, Aug 12, 1999 at 11:18:50AM +0200, Graham Wheeler wrote:
 thinking - wouldn't it be a good idea to add some new tests to test(1),
 to compare files based on criteria like size or modification date?
 
 Anyone else think this is a good idea?


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Graham Wheeler
Aaron Smith wrote:
 
 this seems undesirable to me, since using it immediately makes your shell
 scripts nonportable. i liked the ls -t suggestion though.

Portability is a Good Thing, but I write a lot of one-off scripts
in which portability isn't an issue. Also, just because one uses
standard shell commands is no guarantee of portability, as a shell
script can invoke arbitrary programs, which may or may not be present 
or compatible across different hosts.

-- 
Dr Graham WheelerE-mail: g...@cequrux.com
Cequrux Technologies Phone:  +27(21)423-6065/6/7
Firewalls/Virtual Private Networks   Fax:+27(21)24-3656
Data/Network Security SpecialistsWWW:http://www.cequrux.com/


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Bob Bishop
Hi,

At 4:01 am -0700 12/8/99, Aaron Smith wrote:
this seems undesirable to me, since using it immediately makes your shell
scripts nonportable. i liked the ls -t suggestion though.

Further, isn't test a builtin for most (all?) shells? Sounds like a can of
worms to me...


On Thu, Aug 12, 1999 at 11:18:50AM +0200, Graham Wheeler wrote:
 thinking - wouldn't it be a good idea to add some new tests to test(1),
 to compare files based on criteria like size or modification date?

 Anyone else think this is a good idea?



--
Bob Bishop  (0118) 977 4017  international code +44 118
r...@gid.co.ukfax (0118) 989 4254  between 0800 and 1800 UK




To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Sheldon Hearn


On Thu, 12 Aug 1999 12:26:41 GMT, Bob Bishop wrote:

 Further, isn't test a builtin for most (all?) shells? Sounds like a can of
 worms to me...

If your only motivation for saying it's a can of worms is that test is
usually a builtin, don't sweat it. Lots of scripts insist on using
/bin/test .

Ciao,
Sheldon.


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Sheldon Hearn


On Thu, 12 Aug 1999 13:15:52 +0200, Graham Wheeler wrote:

 Portability is a Good Thing, but I write a lot of one-off scripts
 in which portability isn't an issue.

Not to mention that following NetBSD's lead on issues relating to
portability probably is seldom a bad idea. :-)

Give PR 13091 a bash. Or a sh. Whatever works for you. :-)

Number: 13091
Synopsis:   [PATCH] pdksh-derived replacement for test(1)

Ciao,
Sheldon.


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Sheldon Hearn


On Thu, 12 Aug 1999 12:22:39 +0200, Sheldon Hearn wrote:

 Their code isn't useful in this case, since they've merged in a
 pdksh-derived version of test. How about we do the same? :-)

By the way, OpenBSD have _also_ incorporated NetBSD's test. *evil.grin*

Ciao,
Sheldon.


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Martin Cracauer
  thinking - wouldn't it be a good idea to add some new tests to test(1),
  to compare files based on criteria like size or modification date?

So far it has been policy for FreeBSD not to add options to
commandline utilities that are replaceable by simple shell script
constructs. Especially if that other construct is POSIX-compliant.

Examples:
- An option to date(1), which would print the machine's idea of the
  time, no matter what $TZ is set it. Easily replaceable by 
  (unset  TZ; date)
- An option to a tool that puts out a single line of text to stdout.
  The option would make it print its line without the final newline.
  Easily replaceable by backquotes
  echo `thistool`

Clearly, the functionality discussed falls into this category.

ls -t and head are specified in POSIX, thus it isn't affected by the
usualy shell script unportability like another poster implied.

 this seems undesirable to me, since using it immediately makes your shell
 scripts nonportable. i liked the ls -t suggestion though.
 
 Further, isn't test a builtin for most (all?) shells? Sounds like a can of
 worms to me...

FreeBSD's /bin/sh uses the external /bin/test. Most other shells in
common use have it built in. You are right that this would confuse
people no end since most couldn't use the same test(1) arguments in
theirs scripts and interactivly.

In a word, I'm against it. Whatever you want this for, it's the far
better solution to have your own test(1)-like utility in your personal
search path.

Martin
-- 
%
Martin Cracauer craca...@cons.org http://www.cons.org/cracauer/
BSD User Group Hamburg, Germany http://www.bsdhh.org/


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Brian F. Feldman
On 12 Aug 1999, Dag-Erling Smorgrav wrote:

 Graham Wheeler g...@cequrux.com writes:
  I was writing a script yesterday, and I wanted to have a test to compare
  the modification time of two files. test(1) doesn't have the ability to
  do this. In the end I worked around this by using make(1), but it set me
  thinking - wouldn't it be a good idea to add some new tests to test(1),
  to compare files based on criteria like size or modification date?
 
 NetBSD's test(1) utility has this (-nt and -ot). We should probably
 merge in their changes.

Hmm... this is in pdksh too...

 
 DES
 -- 
 Dag-Erling Smorgrav - d...@flood.ping.uio.no
 

 Brian Fundakowski Feldman  _ __ ___   ___ ___ ___  
 gr...@freebsd.org   _ __ ___ | _ ) __|   \ 
 FreeBSD: The Power to Serve!_ __ | _ \._ \ |) |
   http://www.FreeBSD.org/  _ |___/___/___/ 



To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Brian F. Feldman
On Thu, 12 Aug 1999, Brian F. Feldman wrote:

 On 12 Aug 1999, Dag-Erling Smorgrav wrote:
 
  Graham Wheeler g...@cequrux.com writes:
   I was writing a script yesterday, and I wanted to have a test to compare
   the modification time of two files. test(1) doesn't have the ability to
   do this. In the end I worked around this by using make(1), but it set me
   thinking - wouldn't it be a good idea to add some new tests to test(1),
   to compare files based on criteria like size or modification date?
  
  NetBSD's test(1) utility has this (-nt and -ot). We should probably
  merge in their changes.
 
 Hmm... this is in pdksh too...

In other words, I think we've come upon more reasons to switch.

 
  
  DES
  -- 
  Dag-Erling Smorgrav - d...@flood.ping.uio.no
  
 
  Brian Fundakowski Feldman  _ __ ___   ___ ___ ___  
  gr...@freebsd.org   _ __ ___ | _ ) __|   \ 
  FreeBSD: The Power to Serve!_ __ | _ \._ \ |) |
http://www.FreeBSD.org/  _ |___/___/___/ 
 
 
 
 To Unsubscribe: send mail to majord...@freebsd.org
 with unsubscribe freebsd-hackers in the body of the message
 

 Brian Fundakowski Feldman  _ __ ___   ___ ___ ___  
 gr...@freebsd.org   _ __ ___ | _ ) __|   \ 
 FreeBSD: The Power to Serve!_ __ | _ \._ \ |) |
   http://www.FreeBSD.org/  _ |___/___/___/ 



To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: New tests for test(1)

1999-08-12 Thread Peter Jeremy
I was writing a script yesterday, and I wanted to have a test to compare
the modification time of two files.

I've written programs to do this before as well.  A more portable
approach is
find file1 -newer file2 ...

thinking - wouldn't it be a good idea to add some new tests to test(1),
to compare files based on criteria like size or modification date?

Anyone else think this is a good idea?

It would be nice, but there are portability issues.

Peter


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message