× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Evan Harris wrote:
Hi Hans
...

As to grep in CL (I guess this might be a trick question) I am unaware of an
equivalent and have not bothered going looking. Since there is no
STDIN/STDOUT piping in the standard QCMD shell it seems to me that grep
would be relatively useless, or at best extremely hobbled (but I'm open to
being educated). If I wanted to use grep I would work in QSHELL and have in
the past made good use of this.

Yeah, sneaky example. To search in CL involves some option on some WRK
menu. Frankly, I never did get the hang of that style of programming!
But grep is something I use frequently in the Unix shell.


...

Again, going back to your earlier script example - don't you think a less
terse example might help the next guy no matter how attractive or cool it is
to use the shorter format to demonstrate that you know the switches ? Why
force the next guy to (potentially) go check the manpage when the longer
example might prevent this ? As I asked earlier, would you accept
programmers doing the same thing in a HLL ? What makes it OK in a shell
script ?

Okay, here's the verbose version of my previous example:

------------
#!/bin/sh

# Target of copying
tgt="/media/disk"

# Copy directory structure
find . -type d | sort | while read d; do
mkdir "$tgt/$d"
done

# Copy files
find . -name "*.mp3" |sort | while read f; do
cp --verbose "$f" "$tgt/$f"
done
------------

Sorry, it doesn't get any more verbose than that. BTW, some command
options are indeed consistent among many commands. These include -h or
--help, and -v or --verbose.

(BTW, previously, I wondered if rsync might do what I wanted. I just
tried that today, and it doesn't copy in the desired order. Darn!)

Cheers! Hans


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.