RE: (OT) Hardware Pointers
[EMAIL PROTECTED] said, in part: On a side note, speaking of hardware, I'd like to mention a very disturbing experience I had at a computer show in Salem N.H. yesterday Complain to ncshows.com - quickly and thoroughly. They've been known to kick out disreputable vendors, believe it or not. Yes, you have to be careful, and I've gone to a lot of shows, and have dealt with many of the vendors there, but there are some I won't deal with ever again. I only buy from those whose stores I have visited, and who will be around in the long run. There are some shills there that don't even have enough brains to print up professional business cards, though... Just my 20 millidollars' worth, Bayard --- Bayard R. Coolidge N1HODISCLAIMER: The opinions expressed are Compaq Computer Corp. solely those of the author, and not Nashua, New Hampshire, USA those of Compaq Computer Corporation [EMAIL PROTECTED] (DEC '77-'98) or any other entity. Brake for Moose - It could save your life - N.H. Fish Game Dept. -BEGIN GEEK CODE BLOCK- Version: 3.12 GCS/CC d+ s:+ a++ C+++$ UO++$L++$ P L++$ E-@ W+ N++ o- K? w--- O? M? V-- PS+ PE+ Y+ PGP- t++ 5? X? R* tv b++ DI+++ D? G e++ h-- r++ y? UF++ -END GEEK CODE BLOCK- --- * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Shell scripting tips and tricks (was: I need a date! )
Actually, [ is a link to test. Linux uses a symlink, some Unixes use hard links. -rwxr-xr-x1 root root17496 Sep 20 2001 /usr/bin/test lrwxrwxrwx1 root root4 Dec 1 13:42 /usr/bin/[ - test And yes, BASH has it built in, but on some of the older Bourne shells it is not built in. Speaking of builtin commands vs. Unix commands. While setting the PATH environment variable in a script is a good idea, specifying the full path to a standard command may be a better way. The user may have aliased the commands: alias rm='rm -i' So, in your script (or makefile), setting a variable for the command will bypass any aliases: RM=/bin/rm Same with any other Unix command. So, for the reason of unpredictable aliases, X=$(/usr/bin/ls) Is the more predicatable way to proceed. On 21 Apr 2002 at 22:31, Tom Buskey wrote: Benjamin Scott said: If you are not interested in portability to older shells, here are some optimizations: math=$(( 1 + 1 )) # internal, easier, nestable if [[ a = b ]]; ... # internal I've had problems with [[ ]] on pdksh in the past. [ ] is also internal on modern unixen. Anyone else have some tips or tricks they would like to share? I've done lots of cross platform scripting. I find it's better to set PATH in the top of the script rather then do things like: X=$(/usr/bin/ls) PATH=/usr/bin:$PATH X=$(ls) I've also created something like an include file that I . at the top of my scripts. It has functions I use defines variables for thing like mail. For instance: date | $MAILER -s 'feedback' user@site On linux, MAILER=mail. Solaris, MAILER=mailx. Scripts attached. -- Jerry Feldman [EMAIL PROTECTED] Associate Director Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9 * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Shell scripting tips and tricks (was: I need a date! )
Jerry Feldman said: Actually, [ is a link to test. Linux uses a symlink, some Unixes use hard links. -rwxr-xr-x1 root root17496 Sep 20 2001 /usr/bin/test lrwxrwxrwx1 root root4 Dec 1 13:42 /usr/bin/[ - test And yes, BASH has it built in, but on some of the older Bourne shells it is not built in. As I said in not so many words, modern shells have it built in. I don't consider Bourne a modern shell. If I want test, I use test, not [. I've also used versions of Bourne that didn't have functions for instance (Ultrix). Speaking of builtin commands vs. Unix commands. While setting the PATH environment variable in a script is a good idea, specifying the full path to a standard command may be a better way. The user may have aliased the commands: alias rm='rm -i' So, in your script (or makefile), setting a variable for the command will bypass any aliases: RM=/bin/rm Or RM=\rm so that aliasing is negated. I don't alias rm and my root accounts don't either. Same with any other Unix command. So, for the reason of unpredictable aliases, X=$(/usr/bin/ls) Is the more predicatable way to proceed. Maybe. Now if I'm trying to run gnutar, on linux, it's /usr/bin/tar. On my solaris box it depends on the site. I've seen /usr/local/bin, /opt/ something, /usr/local/gnu, /local, etc. Even variations for each archetecture. I've also seen it called gtar or gnutar. It depends, of course, on your environment. Sometimes you want the full path, sometimes not. Specifying the full path for each program makes portability more difficult (think #ifdef in C). SunOS puts many programs in /usr/ccs for instance. Solaris has stuff in /usr/ucb. HP-UX and SGI use /usr/ bsd. -- --- Tom Buskey * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Shell scripting tips and tricks (was: I need a date! )
=Jerry Feldman said: =Actually, [ is a link to test. Linux uses a symlink, some Unixes use hard =links. =-rwxr-xr-x1 root root17496 Sep 20 2001 /usr/bin/test =lrwxrwxrwx1 root root4 Dec 1 13:42 /usr/bin/[ - test = =And yes, BASH has it built in, but on some of the older Bourne shells it is =not built in. = =As I said in not so many words, modern shells have it built in. I don't =consider Bourne a modern shell. If I want test, I use test, not [. =I've also used versions of Bourne that didn't have functions for =instance (Ultrix). Just to muddy the waters even further... Bourne shell under Linux is actually a link to bash. Both the [ operator and the test command are both builtins to both Bourne and bash. The [[ operator is actually different from a builtin; it is considered a keyword. It also has different syntax in that certain operators are not legal and vice versa. If you ever really and truly ever want to run the binary test (though I have no idea why you would), you have to explicity invoke it via pathname. e.g., if /usr/bin/test ${x} -eq 44 then echo walla fi -- -Time flies like the wind. Fruit flies like a banana. Stranger things have - -happened but none stranger than this. Does your driver's license say Organ -Donor?Black holes are where God divided by zero. Listen to me! We are all- -individuals! What if this weren't a hypothetical question? [EMAIL PROTECTED] * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Shell scripting tips and tricks (was: I need a date! )
On Mon, 22 Apr 2002, Tom Buskey [EMAIL PROTECTED] wrote: As I said in not so many words, modern shells have it built in. I don't consider Bourne a modern shell. I believe Jerry is saying some of the newer implementations of /bin/sh have [ as a builtin. For example, [ has been a builtin on Solaris forever. This improves performance of scripts, e.g. a big loop with lots of if tests. Speaking of builtin commands vs. Unix commands. While setting the PATH environment variable in a script is a good idea, specifying the full path to a standard command may be a better way. The user may have aliased the commands: alias rm='rm -i' So, in your script (or makefile), setting a variable for the command will bypass any aliases: RM=/bin/rm Or RM=\rm so that aliasing is negated. I don't alias rm and my root accounts don't either. I don't believe user's aliases are active at all in a general script. The ~/.bashrc ~/.profile, etc are not sourced for non-interactive shells. Only in an interactive shell will the these aliases be available. Karl * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Another (simpler) bash scripting question...
Hey, all - I'm attempting to write a script to put in cron.weekly that will find the 25 users who use the most disk space and email them a warning. My relatively simple question is: Is there anything in bash that is the equivelent to the old basic mid/left/right way of cutting down a variable? If I have a line from the du output, basically I'm trying to define a variable for the corresponding username (in other words, given: 1234M /home/USER I want 'USER so as to then turn around and email that user. (I already have way of removing non-user directories in /home). Any thoughts? Oh, and this is fora RH7.2 system and really does not need to be all that portable. Thanks, Brian --- | [EMAIL PROTECTED]Spam me and DIE! | | http://www.datasquire.net | | Co-Founder Co-Owner of| | Data Squire Internet Services | --- * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Another (simpler) bash scripting question...
DISKHOG=`echo 1234M /home/USER | sed -e 's;^.*/;;'` * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Another (simpler) bash scripting question...
How about something like: du -sb ./*|sort -g|tail|sed 's/\.\///'|awk '{print $2}' to get the names... and then wrap it up in a mail command... it's not a bash script since it forks a few times, but it's a quick'n'dirty. Ben On Mon, 22 Apr 2002, Brian Chabot wrote: Hey, all - I'm attempting to write a script to put in cron.weekly that will find the 25 users who use the most disk space and email them a warning. My relatively simple question is: Is there anything in bash that is the equivelent to the old basic mid/left/right way of cutting down a variable? If I have a line from the du output, basically I'm trying to define a variable for the corresponding username (in other words, given: 1234M /home/USER I want 'USER so as to then turn around and email that user. (I already have way of removing non-user directories in /home). Any thoughts? Oh, and this is fora RH7.2 system and really does not need to be all that portable. Thanks, Brian --- | [EMAIL PROTECTED]Spam me and DIE! | | http://www.datasquire.net | | Co-Founder Co-Owner of| | Data Squire Internet Services | --- * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. * -- Simulated disorder postulates perfect discipline; simulated fear postulates courage; simulated weakness postulates strength. ~ Sun Tzu * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Another (simpler) bash scripting question...
On Mon, 22 Apr 2002 [EMAIL PROTECTED] wrote: I said: in other words, given: 1234M /home/USER I want USER so as to then turn around and email that user. (I already have way of removing non-user directories in /home). Woo hoo! Thanks for all the lightning fast help. I already had most of the script written, but now I think I'll go back and re-write much of it thanks to all your input! You can use 'cut' or 'awk' for this: du -sk /home/* | sort -nr | cut -f3 -d/ I think cut was what I was looking for. Thanks, (I was also going to do a 'du -chxs ~$USER/*' to get them a breakdown, but I may modify that.) For the first 25 users or so, you could do something like: [snip] Note, this isn't tested in any way. It's just something to experiment with. Thanks! I might just incorporate parts of this. The script is for a client, but I think I like the idea enough to make it a little better than they need it. I'll probably make it a bit more configurable with variables that can be set depending on the system (on the one this is for, $home can be on any of three nfs mounted filesystems... Any way, again, thanks for all the help! Brian --- | [EMAIL PROTECTED]Spam me and DIE! | | http://www.datasquire.net | | Co-Founder Co-Owner of| | Data Squire Internet Services | --- * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Shell scripting tips and tricks (was: I need a date! )
That is also correct. I had forgotten. But, my original point is that it is probably better to specify the full pathname of a command. X=$(/bin/ls) will generally result in identical results as: PATH=/bin:$(PATH) X=$(ls) But, specifying the full pathname also forces the command to be executed even if some version of the shell internalizes it or if the script somehow sources ~/.bashrc directly or indirectly. On 22 Apr 2002 at 7:28, Karl J. Runge wrote: I don't believe user's aliases are active at all in a general script. The ~/.bashrc ~/.profile, etc are not sourced for non-interactive shells. Only in an interactive shell will the these aliases be available. -- Jerry Feldman [EMAIL PROTECTED] Associate Director Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9 * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Shell scripting tips and tricks (was: I need a date! )
Yes, but several Unix systems supply an old style Bourne SH as well as a POSIX shell (essentially ksh scaled down) and ksh. KSH implemented the [[ as a way of internalizing the condition. For the most part, the syntax will work in most Bourne derived shells. if [ condition ] then # true stuff fi If the [ is internalized, then the script will perform better. On 22 Apr 2002 at 10:14, Steven W. Orr wrote: Just to muddy the waters even further... Bourne shell under Linux is actually a link to bash. Both the [ operator and the test command are both builtins to both Bourne and bash. The [[ operator is actually different from a builtin; it is considered a keyword. It also has different syntax in that certain operators are not legal and vice versa. If you ever really and truly ever want to run the binary test (though I have no idea why you would), you have to explicity invoke it via pathname. e.g., if /usr/bin/test ${x} -eq 44 then echo walla fi -- -Time flies like the wind. Fruit flies like a banana. Stranger things have - -happened but none stranger than this. Does your driver's license say Organ -Donor?Black holes are where God divided by zero. Listen to me! We are all- -individuals! What if this weren't a hypothetical question? [EMAIL PROTECTED] * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. * -- Jerry Feldman [EMAIL PROTECTED] Associate Director Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9 * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Another (simpler) bash scripting question...
On Mon, Apr 22, 2002 at 12:16:15PM -0400, Brian Chabot [EMAIL PROTECTED] wrote: On Mon, 22 Apr 2002 [EMAIL PROTECTED] wrote: I said: in other words, given: 1234M /home/USER I want USER so as to then turn around and email that user. (I already have way of removing non-user directories in /home). Woo hoo! Thanks for all the lightning fast help. I already had most of the script written, but now I think I'll go back and re-write much of it thanks to all your input! Yuck, yuck, yuck! It looks like everyone was pointing out ways to use sed to accomplish this. Now, sed may give you extra power, but when writing shell scripts, I prefer to avoid using external commands where possible. To that extent, consider: $ foo=1234M /home/USER $ echo ${foo##*/} USER $ Look at the bash man page for '#', '##', '%', and '%%'. -- Bob BellCompaq Computer Corporation Software Engineer 110 Spit Brook Rd - ZKO3-3/U14 TruCluster GroupNashua, NH 03062-2698 [EMAIL PROTECTED] 603-884-0595 * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Shell scripting tips and tricks (was: I need a date! )
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 At some point hitherto, Jerry Feldman hath spake thusly: Actually, [ is a link to test. Linux uses a symlink, some Unixes use hard links. -rwxr-xr-x1 root root17496 Sep 20 2001 /usr/bin/test lrwxrwxrwx1 root root4 Dec 1 13:42 /usr/bin/[ - test And yes, BASH has it built in, but on some of the older Bourne shells it is not built in. As Tom points out, modern flavors of Unix generally use a Bourne-derivative, Posix-compliant shell (often referred to as the Posix shell) which includes these as a built-in. The original Bourne shell is generally shipped on these systems too, but you often need to modify your configuration or specify the full path to it to use it. Most will not do this, as the Bourne shell lacks nice features that most other modern shells have. Few shells still rely on the existence of /usr/bin/test or its link to [, though I do often see it used by the make utility - -- Derek Martin [EMAIL PROTECTED] - - I prefer mail encrypted with PGP/GPG! GnuPG Key ID: 0x81CFE75D Retrieve my public key at http://pgp.mit.edu Learn more about it at http://www.gnupg.org -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8xFGXdjdlQoHP510RAtmRAJ46Yn2rVMUfs0i0wkBmTSZbK7WKegCgt5Gh pzQE9zjvzRCBGTO5cZw4oGI= =upIm -END PGP SIGNATURE- * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Another (simpler) bash scripting question...
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Content-Type: text/plain; charset=us-ascii In a message dated: Mon, 22 Apr 2002 14:03:32 EDT Bob Bell said: Look at the bash man page for '#', '##', '%', and '%%'. Are these built-ins also available in the real Bourne Shell, and/or ksh? Or are they strictly a bash thing?[1] If they only exist within bash, then I wouldn't advocate their use if you're goal is portable shell code. Of course, if your goal is portability, just write it in perl and be done with it :) [1] Since I only have access to a Linux system where /bin/sh *is* bash, I can't check this myself :( - -- Seeya, Paul -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Exmh version 2.2 06/23/2000 (debian 2.2-1) iD8DBQE8xFMyuweSOVPxKO4RArNzAJ9OmJPgP9EuGeyWH4FXxSYwU0KIZwCeNli5 pv+ICz/cM58MQBKzg9o6ZAI= =SRuG -END PGP SIGNATURE- * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
RE: Another (simpler) bash scripting question...
Yuck, yuck, yuck! It looks like everyone was pointing out ways to use sed to accomplish this. Now, sed may give you extra power, but when writing shell scripts, I prefer to avoid using external commands where possible. To that extent, consider: $ foo=1234M /home/USER $ echo ${foo##*/} USER $ Here's a simple question for the group. How do I loop through each line of output in the bourne shell when the line also contains spaces? If I use the 'for' keyword, it loops through each word rather than each line. E.g: % /usr/bin/echo line 1\nline 2 line 1 line 2 % for LINE in `/usr/bin/echo line 1\nline 2` do echo $LINE done line 1 line 2 Does anyone know how to loop through each line instead, so that the output would be line 1 line 2 ? Thanks. Warren * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Another (simpler) bash scripting question...
Mansur, Warren [EMAIL PROTECTED] writes: Does anyone know how to loop through each line instead, so that the output would be line 1 line 2 ? Thanks. echo -ne 'line 1\nline 2\n' | while read foo ; do echo $foo ; done -- John Abreau / Executive Director, Boston Linux Unix ICQ 28611923 / AIM abreauj / JABBER [EMAIL PROTECTED] / YAHOO abreauj Email [EMAIL PROTECTED] / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9 PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99 The Earth is degenerating these days. Bribery and corruption abound. Children no longer mind their parents, every man wants to write a book, and it is evident that the end of the world is fast approaching. (translated from an Assyrian stone tablet, c. 2800 B.C.) msg14340/pgp0.pgp Description: PGP signature
RE: Another (simpler) bash scripting question...
I have not tried it, but what about setting IFS to newline only. n 22 Apr 2002 at 14:42, Mansur, Warren wrote: Does anyone know how to loop through each line instead, so that the output would be line 1 line 2 ? Thanks. -- Jerry Feldman [EMAIL PROTECTED] Associate Director Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9 * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Another (simpler) bash scripting question...
On Mon, Apr 22, 2002 at 02:15:14PM -0400, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: In a message dated: Mon, 22 Apr 2002 14:03:32 EDT Bob Bell said: Look at the bash man page for '#', '##', '%', and '%%'. Are these built-ins also available in the real Bourne Shell, and/or ksh? Or are they strictly a bash thing?[1] If they only exist within bash, then I wouldn't advocate their use if you're goal is portable shell code. Well, of course it depends on your goal. Limiting yourself to Bourne shell is at times necessary, but makes many things much more difficult. For what it's worth, what I mentioned is also available in ksh (which is where I actually learned it), but not in original Bourne shell. -- Bob BellCompaq Computer Corporation Software Engineer 110 Spit Brook Rd - ZKO3-3/U14 TruCluster GroupNashua, NH 03062-2698 [EMAIL PROTECTED] 603-884-0595 * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Another (simpler) bash scripting question...
it has a subtle scoping gotcha that drove me nuts the first time I tripped over it - anybody know what I'm referring to? No? Then how about this? result=badness# init with failure default spewSomeKindOfOutput | while read input do result=goodness done echo $result What is the output? * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
RE: Another (simpler) bash scripting question...
No? Then how about this? result=badness# init with failure default spewSomeKindOfOutput | while read input do result=goodness done echo $result What is the output? badness Lemme guess. The pipe to the while actually creates a child process, and a child process can't affect the parent's environ array. Am I close? :D * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
RE: Another (simpler) bash scripting question...
echo -ne 'line 1\nline 2\n' | while read foo ; do echo $foo ; done Thanks to all for their answers. I've always wanted to do this but didn't know how until now. Works like a charm! Warren * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Another (simpler) bash scripting question...
[EMAIL PROTECTED] (Michael O'Donnell) writes: it has a subtle scoping gotcha that drove me nuts the first time I tripped over it - anybody know what I'm referring to? No? Then how about this? result=badness# init with failure default spewSomeKindOfOutput | while read input do result=goodness done echo $result What is the output? In general, the inner part of the loop is run in a sub-shell. This is often transparent, but if you have an expression that has side-effects, these effects blip out of existance when the sub-shell disappears. Regards, --kevin -- Kevin D. Clark (CetaceanNetworks.com!kclark) | Cetacean Networks, Inc. | Give me a decent UNIX Portsmouth, N.H. (USA)| and I can move the world alumni.unh.edu!kdc (PGP Key Available)| * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Another (simpler) bash scripting question...
On Mon, Apr 22, 2002 at 05:15:00PM -0400, Mansur, Warren [EMAIL PROTECTED] wrote: No? Then how about this? result=badness# init with failure default spewSomeKindOfOutput | while read input do result=goodness done echo $result What is the output? badness Hrm badness in bash, pdksh, and Tru64's SVR4 /bin/sh. goodness in Tru64's POSIX.2/XCU5.0 /bin/posix/sh, Tru64's ksh, and zsh. ...that can't be good... -- Bob BellCompaq Computer Corporation Software Engineer 110 Spit Brook Rd - ZKO3-3/U14 TruCluster GroupNashua, NH 03062-2698 [EMAIL PROTECTED] 603-884-0595 * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Another (simpler) bash scripting question...
On Mon, 22 Apr 2002, at 2:15pm, [EMAIL PROTECTED] wrote: If they only exist within bash, then I wouldn't advocate their use if you're goal is portable shell code. If portability is a concern, depending on the environment, it is sometimes easier to install the GNU tools everywhere than try to craft something that works on all the native tools. Install the GNU tool once, and be done with it, or spend the rest of your life porting your own code. :-) -- Ben Scott [EMAIL PROTECTED] | The opinions expressed in this message are those of the author and do not | | necessarily represent the views or policy of any other person, entity or | | organization. All information is provided without warranty of any kind. | * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: IRobot
On 21 Apr 2002, at 10:44pm, Kenneth E. Lussier wrote: Speaking of um, er, Iced Tea, an completely unrelated to the subject of robots, I thought many people would get a kick out this: http://www.thinkgeek.com/stuff/looflirpa/beer.shtml Do not taunt Happy Fun Ball. ;-) -- Ben Scott [EMAIL PROTECTED] | The opinions expressed in this message are those of the author and do not | | necessarily represent the views or policy of any other person, entity or | | organization. All information is provided without warranty of any kind. | * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Another (simpler) bash scripting question...
In general, I try to write my scripts portable so that I can use them on other platforms. In the past 5 years, I have had jobs with Tru64 Unix, HP- UX (10.20 and 11.x), Solaris (7 and 8), and Linux (Debian, Red Hat and SuSE). Most of my personal scripts are small and work across platform. My more complex scripts tend to be more bashful(sic.). or ksh. All of my scripts contain #1shell in the first line. -- Jerry Feldman [EMAIL PROTECTED] Associate Director Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9 * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
AMD vs Intel (was: Hardware Pointers)
On 21 Apr 2002, at 3:38pm, Rich Cloutier wrote: 1. If your heatsink falls off or your CPU fan dies, the processor just slows down and stops. I doesn't die like AMD processors do. If the CPU fan dies, or you power-on without a heatsink, an AMD system should halt safely. The heatsink falls off case is real. AMD considers the over-temp protection function to be the job of the motherboard, not the CPU. I -- and pretty much the rest of the world -- disagree, but that is the way it is (for now, anyway). For the heatsink falls off scenario, the sensor/monitor AMD provided in their reference design does not react fast enough, resulting catastrophic, permanent failure of the chip package -- i.e., it literally burns up. If the fan dies, or you power-on without a heatsink, the temperature rise is (in theory) slow enough that the monitoring electronics can see the problem and kill the power before any permanent damage occurs. Supposedly, AMD is working with motherboard OEMs to create a better sensor/monitor design which can react fast enough for all scenarios. Note: This is all based on what I have read online from various sites. I only have one AMD Athlon, which I paid good money for, and I am not about to test it by pulling the heatsink off while it is running. ;-) (I'm not about to do it for the Intel PIII I'm typing this on, either.) 2. There don't seem to be too many chipset choices for AMD processors besides VIA ... VIA, SIS, ALI, and AMD all make chipsets for the K7 (Athlon/Duron) series. ... based on MY experience and those of others I have read, VIA are not the best chipset manufacturers out there. My analysis of the situation has not so much been that the chipsets stink, but that some motherboard OEMs do a lousy job of integrating them. There is a lot more flexibility of design in the AMD world. Since AMD's products have a lower price, there also tend to be a lot more entry-level products (read: cheap pieces of junk) in the AMD world. The result is that there is a much greater opportunity to buy a lemon. As with Linux, more available choices means more bad choices as well as more good choices. I still prefer choice. 3. With Intel, you NEVER have to worry if there is a software comatibility issue. Bull. Remember the F00F bug? How about the FDIV bug? There are others, too. All chips have bugs, including Intel's. If you want, you can declare whatever Intel's chips do is correct, but you can do that for AMD, too. It is a pissing contest either way. What really matters is, Can you get your work done? Both brands provide a yes answer in nearly every case (with the errata being evenly distributed for both as well). The prices of equivalently perfoming Athlons are generally cheaper than Intel P4, although this could change in the coming weeks with Intel's recent and upcoming price cuts. Back in the days when RAMBUS was your only option for the P4, the price/performance ratio for an AMD Athlon solution was about twice that of the Intel P4. In other words, for a given amount of cash, you could buy twice as much AMD system as you could Intel system. Now that Intel has decided that RAMBUS was a Bad Idea(TM), P4 SDR and DDR SDRAM solutions have leveled the playing field. The fact that Dell is selling P4 systems at what has to be below cost helps, too. :-) -- Ben Scott [EMAIL PROTECTED] | The opinions expressed in this message are those of the author and do not | | necessarily represent the views or policy of any other person, entity or | | organization. All information is provided without warranty of any kind. | * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: (OT) Hardware Pointers
On 21 Apr 2002, at 3:38pm, Rich Cloutier wrote: Keep in mind that ANY new motherboard you buy today will have NO ISA slots. Not strictly true; you can still find them. However, ISA has become a specialty item, and actually commands a higher price because of that. I never go to hardware shows; to my mind, it's equivalent to buying Rolexes off a guy on the street corner. The PC shows are strictly caveat emptor. You can and will find reputable vendors selling good stuff there. You can and will find vendors selling junk that is, at least, presented as junk. And you will find con artists. Sure you might get a fantastic deal, but if you don't, where's the support? Same place as with Best Buy: The vendor and/or the OEM. For example, PC Authority, one of the NCShow regulars, has been selling computers in this area for over ten years. I buy from them all the time. I have had one or two bad eggs. The one that sticks out in my mind is a fan, which I simply brought backĀ and they exchanged it. In the case of my Athlon CPU, I bought a retail box, which means I can also go back to AMD if I need to. I search pricewatch.com for prices and have a list of resellers that I use. Hah! You won't go to a PC show, but you buy off PriceWatch listings? :-) At least with the PC shows, I have the world's oldest warranty: If the thing I buy does not work, I can track the vendor down and beat him over the head with it! ;-) -- Ben Scott [EMAIL PROTECTED] | The opinions expressed in this message are those of the author and do not | | necessarily represent the views or policy of any other person, entity or | | organization. All information is provided without warranty of any kind. | * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Memory types (was: Hardware Pointers)
On 21 Apr 2002, at 12:15pm, Kenneth E. Lussier wrote: One of the problems is that there seem to be many different levels of DDR (ranging from PC1600 to PC3200). Heh. Well, PC66, PC100, and PC133 all refer to the clock speed of the bus driving the memory. 66 MHz, 100 MHz, and 133 MHz. After that, sanity departs. You see, along came RAMBUS, which uses a much higher clock (600 MHz or 800 MHz), but with a much narrower data bus (8-bit, I think). So RAMBUS could advertise PC800 RAM, which fooled stupid people into think that PC800 was eight times better than PC100. So the SDRAM camp decided to come up with a designation that measured the memory bandwidth, resulting in designations like PC1600, which fooled stupid people into thinking that PC1600 was twice as better as PC800 RAMBUS. (Smart people like you and me just go, WTF is with all these numbers?!?) For the record, PC400 and PC800 are RAMBUS RAM (RDRAM), which is evil. PC1600 is DDR with an actual clock of 100 MHz and an effective clock of 200 MHz. PC2100 is DDR with an actual clock of 133 MHz and an effective clock of 266 MHz. I am not sure on the DDR300 and DDR333 stuff, other than to say that I have heard rumor that some of it is just overclocked DDR266. Are we sufficiently confused yet? :-) -- Ben Scott [EMAIL PROTECTED] | The opinions expressed in this message are those of the author and do not | | necessarily represent the views or policy of any other person, entity or | | organization. All information is provided without warranty of any kind. | * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: (OT) Hardware Pointers
On 21 Apr 2002, at 12:15pm, Kenneth E. Lussier wrote: ... hardware ... point me in the right directions ... http://www.anandtech.com/ http://www.tomshardware.com http://www.amdmb.com http://www.maximumpc.com I am looking to buy a new motherboard ... http://www.asus.com http://www.epox.com http://www.tyan.com -- Ben Scott [EMAIL PROTECTED] | The opinions expressed in this message are those of the author and do not | | necessarily represent the views or policy of any other person, entity or | | organization. All information is provided without warranty of any kind. | * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: AMD vs Intel (was: Hardware Pointers)
- Original Message - From: Benjamin Scott [EMAIL PROTECTED] To: Greater NH Linux Users' Group [EMAIL PROTECTED] Sent: Monday, April 22, 2002 10:05 PM Subject: AMD vs Intel (was: Hardware Pointers) On 21 Apr 2002, at 3:38pm, Rich Cloutier wrote: 1. If your heatsink falls off or your CPU fan dies, the processor just slows down and stops. I doesn't die like AMD processors do. If the CPU fan dies, or you power-on without a heatsink, an AMD system should halt safely. The heatsink falls off case is real. SHOULD, but doesn't. I have talked to numerous OEMs of AMD processors and motherboards, and they have told me many stories of idiots who have installed their Athlon and Duron CPUs and powered the motherboards up without a heat sink, just to see if they worked and have fried in some cases 3 CPUs in a row. AMD considers the over-temp protection function to be the job of the motherboard, not the CPU. I -- and pretty much the rest of the world -- disagree, but that is the way it is (for now, anyway). For the heatsink falls off scenario, the sensor/monitor AMD provided in their reference design does not react fast enough, resulting catastrophic, permanent failure of the chip package -- i.e., it literally burns up. If the fan dies, or you power-on without a heatsink, the temperature rise is (in theory) slow enough that the monitoring electronics can see the problem and kill the power before any permanent damage occurs. Supposedly, AMD is working with motherboard OEMs to create a better sensor/monitor design which can react fast enough for all scenarios. If the fan dies, you get a slow rise in temperature which should cause the current circuitry to work. However, powering the chip on with no heatsink is not really any different than removing the heatsink from a running processor. The core and substrate are not nearly massive enough to dissipate the heat generated. The only advantage you MIGHT get is the difference between normal operating temperature (40 degrees C or so) and room temperature. The article referenced below: http://www6.tomshardware.com/cpu/01q3/010917/heatvideo-01.html mentions that the processors smoke and reach temps of over 300C within seconds: Those pictures cannot show you what happened by far as good as our test-lab video. A split second after the heat sink had been taken off the Palomino-Athlon, the system crashed. We then watched in horror as smoke clouds rose from the overheating core. The temperature measurement ensured us of what we had feared. No semiconductor survives almost 300 degrees Celsius / 580 degrees Fahrenheit. Palomino was dead. 15 degrees is a very small part of THAT temperature curve. AMD IS working on a solution: http://www6.tomshardware.com/column/01q4/011029/index.html but there is still a large number of motherboards on the market without this feature. Note: This is all based on what I have read online from various sites. I only have one AMD Athlon, which I paid good money for, and I am not about to test it by pulling the heatsink off while it is running. ;-) (I'm not about to do it for the Intel PIII I'm typing this on, either.) Nor am I. But I feel better knowing that if my fan dies or my socket cracks, my CPU is likely to survive the ordeal. 2. There don't seem to be too many chipset choices for AMD processors besides VIA ... VIA, SIS, ALI, and AMD all make chipsets for the K7 (Athlon/Duron) series. ... based on MY experience and those of others I have read, VIA are not the best chipset manufacturers out there. My analysis of the situation has not so much been that the chipsets stink, but that some motherboard OEMs do a lousy job of integrating them. There is a lot more flexibility of design in the AMD world. Since AMD's products have a lower price, there also tend to be a lot more entry-level products (read: cheap pieces of junk) in the AMD world. The result is that there is a much greater opportunity to buy a lemon. Well then the junk manufacturers use VIA for Intel solutions too, because I have had problems with all the VIA motherboards I have used, regardless of platform. As with Linux, more available choices means more bad choices as well as more good choices. I still prefer choice. 3. With Intel, you NEVER have to worry if there is a software comatibility issue. Bull. Remember the F00F bug? How about the FDIV bug? There are others, too. All chips have bugs, including Intel's. If you want, you can declare whatever Intel's chips do is correct, but you can do that for AMD, too. It is a pissing contest either way. Bugs is one thing. How fast the workarounds are created is another. True, it is a perception issue, but it's still important. If you don't agree, go ask the folks from Cyrix. What really matters is, Can you get your work done? Both brands provide a yes answer in nearly every case (with the errata being evenly distributed for both as
Re: (OT) Hardware Pointers
Ben Boulanger [EMAIL PROTECTED] writes: I'm quite happy with my AMD Athlon boxes. I'm thinking about a new machine too. What motherboard do you have? Would that be your recommendation now for an Athlon? For dual Athlons? What's a good video card that has solid support in XFree86? - Jim Van Zandt * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: AMD vs Intel (was: Hardware Pointers)
On Mon, 22 Apr 2002, at 6:12pm, Rich C wrote: However, powering the chip on with no heatsink is not really any different than removing the heatsink from a running processor. I believe the theory was that there were in fact relevant differences, but I sure don't know what they were supposed to be. If I had to guess, maybe the processor does not run at full clock upon power on? I dunno. In any event, I certainly don't regard the motherboard method as a full-proof solution. OTOH, I do not regard the failure cases as mission-fatal to people who know what they are doing. Yah, if you don't put the heatsink on your CPU, you loose. So don't do that, then. ;-) FWIW, I also don't understand why AMD doesn't just put a last-chance, thermal-interlock in their chips that kills the power if it gets near melt-down. Well then the junk manufacturers use VIA for Intel solutions too, because I have had problems with all the VIA motherboards I have used, regardless of platform. Same scenario. Intel's chipsets are expensive, so they do not get used in the el-cheapo motherboards. If you are building a bottom-of-the-barrel board, you are not going to buy the most expensive components on the market. I've met -- hell, I've *owned* -- boards with VIA chips that were flat-out defective by design. The VA-503 from FIC is a good example -- I've encountered several of them, and most of them never even managed to boot MS Windows 98! You had to load PCI slots in a certain order, or it would not POST. But my favorite flaw was that if you put cards in all four PCI slots and the AGP slot, one of the power SCRs would **melt**! On the other hand, I've used high-quality boards with VIA chipsets that have never given me a second of trouble. The difference is in the quality of the board, not the chipset. I'm not trying to say that all VIA chipsets are top performers. They aren't. But Intel has put out some dogs, too. i810, anyone? :) Bugs is one thing. How fast the workarounds are created is another. I'm really not sure what you are trying to say there. If you mean the speed of the fix... well, if I remember correctly, Intel had to face major media pressure before they even admitted the FDIV bug existed... ? True, it is a perception issue, but it's still important. Eh? Are we talking technical merits here, or who has the bigger marketing budget? :) If marketing muscle is an important factor, then I guess I should stop using this Linux thing... ;-) What really matters is, Can you get your work done? Both brands provide a yes answer in nearly every case (with the errata being evenly distributed for both as well). The errata is masked by the fact that most people use Windows. Server admins mostly use Intel. I really don't get what you are trying to say here. How are processor bugs masked by the fact that most people use MS Windows? And what does the fact that server admins mostly use Intel have to do with that? RAMBUS isn't a bad idea. It was a Bad Decision(TM) in that it was a proprietary architecture (read expensive) ... Well, I dunno about you, but proprietary and over-priced are both bad ideas in my book. :-) ... and it was ahead of it's time. There is also the latency issue, which I have yet to have confirmed or denied to my satisfaction. But the fact that you CAN overclock an Intel processor much more than an AMD processor ... Would you mind backing that up with some references? I am not an overclocker, but I do read about that stuff from time to time, and everything I've encountered has indicated a strong preference for AMD over Intel in the OC world. My understanding is that Intel makes it much harder to overclock their chips. There is also the issue of the 1.13 GHz Pentium III, which was *already* overclocked, by Intel, beyond stable limits. That's not what I would call much more, but rather, much less. :-) ... says a lot for the overhead that these processors have in terms of stability and reliability. You could look at it that way. You could also say Intel is selling you a product that has been deliberately de-tuned. If the chip is capable of running stable at 1200 MHz, I would like the manufacturer to sell it as such, and not lock it at 800 MHz just to keep prices high. By all accounts, Intel is killing off the PIII line not because its time had gone, but because the price/performance ratio beats out the P4 by a considerable margin. -- Ben Scott [EMAIL PROTECTED] | The opinions expressed in this message are those of the author and do not | | necessarily represent the views or policy of any other person, entity or | | organization. All information is provided without warranty of any kind. | * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body.
Re: (OT) Hardware Pointers
On Mon, 22 Apr 2002, at 9:19pm, James R. Van Zandt wrote: What motherboard do you have? I have an Epox EP-8K7A+, and I have been very happy with it. No problems to speak of. Board design and layout is impressive. The manual, while still lacking in the detail I really want (remember when computer manuals included schematics?), is significantly above average. Included software worked well for Microsoftland. Linux was happy with it. http://www.epox.com/html/english/products/motherboard/ep-8k7a+.htm One feature that scores extra Geek Points is the onboard POST code display. :-) Would that be your recommendation now for an Athlon? Depends on what your needs are. What sort of usage (e.g., word processing vs Quake III)? Are you looking for an all-in-one, everything-on-board design? Or do you prefer the minimalist, bare-bones, everything-is-an-expansion-card approach? Do you want IDE RAID? What OSes do you plan on using with it? One thing you can do to save a lot of money is buy components six months to one year behind the curve. The performance is almost as good, but the price is often 25% of original, since the vendors want to get rid of their remaining stock. For dual Athlons? You can be sure Tyan (http://www.tyan.com) will do well. AMD and Tyan partnered to make AMD's multiprocessor product a reality. I have generally had very good luck with Asus, and they have a dual-proc AMD board out. I have not heard anything one way or the other about it, though: http://usa.asus.com/mb/socketa/a7m266-d/overview.htm What's a good video card that has solid support in XFree86? From what I am told, the best choice for Open Source drivers is ATI. The NVidia line is a better performer, and solid, but the drivers are binary-only. Your Mileage May (And Likely Will) Vary! -- Ben Scott [EMAIL PROTECTED] | The opinions expressed in this message are those of the author and do not | | necessarily represent the views or policy of any other person, entity or | | organization. All information is provided without warranty of any kind. | * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: (OT) Hardware Pointers
On Mon, 2002-04-22 at 21:19, James R. Van Zandt wrote: Ben Boulanger [EMAIL PROTECTED] writes: I'm quite happy with my AMD Athlon boxes. I'm thinking about a new machine too. What motherboard do you have? Would that be your recommendation now for an Athlon? For dual Athlons? I don't know that I would spend the money on a dual Athlon board. Does anyone really need that much power in a desktop system? OK, I can understand wanting it, but the Athlon MP chips are expensive, and so are the motherboards. The board that I am looking at is the Shuttle AK35GTR. I have read a bunch of reviews on it, and so far everyone seems to like it. Someone made a comment earlier about not being able to overclock Athlons,but this review of the AK35GTR seems to refute that (http://www.overclockersonline.com/?page=articlesnum=124). Another thing that this particular board has going for it is that it supports everything from the Duron 500MHz through the AthlonXP 2000+. It also has four DDR RAM slots supporting upto 4GB of RAM. Most boards these days max out at three slots. What's a good video card that has solid support in XFree86? I'm currently using an ATI Radeon 64MB-DDR VIVO card, and it's been rock solid. I've been using ATI cards exclusively for the last 5 years, and I have never had a problem with X. Unless you count the Rage Fury MAXX card, which needs two configuration sections in the XF86Config because it has two CPU's and two separate memory buses. It worked, but it took forever to figure out how to get it running. C-Ya, Kenny * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: (OT) Hardware Pointers
On 22 Apr 2002, at 8:38pm, Kenneth E. Lussier wrote: I don't know that I would spend the money on a dual Athlon board. Does anyone really need that much power in a desktop system? As alway, it depends. If you compile code (i.e., software development) on a regular basis, two CPUs is definately worth it. The same applies to CAD and scientific analysis. If you run emulators like Wine, Win4Lin, or VMware, multiple CPUs is definately worth it. If you do a lot of mutli-tasking where jobs execute in the background, two CPUs might be worth it. If all you do is browse the web, than you can get by pretty well with a 300 MHz K6 and 128 MB of RAM. :-) -- Ben Scott [EMAIL PROTECTED] | The opinions expressed in this message are those of the author and do not | | necessarily represent the views or policy of any other person, entity or | | organization. All information is provided without warranty of any kind. | * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: (OT) Hardware Pointers
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 At some point hitherto, Kenneth E. Lussier hath spake thusly: On Mon, 2002-04-22 at 21:19, James R. Van Zandt wrote: I'm thinking about a new machine too. What motherboard do you have? Would that be your recommendation now for an Athlon? For dual Athlons? I don't know that I would spend the money on a dual Athlon board. Does anyone really need that much power in a desktop system? OK, I can understand wanting it, but the Athlon MP chips are expensive, and so are the motherboards. FWIW, IIRC you do not need to buy Athlon MP processors to use them in SMP configurations. (How many acronyms can one use in one sentence? :) And the answer to your question is yes, people really do need that much power in a desktop system. Just not all of them. Depends on what you use it for. If you're trying to solve complex mathematical problems or decrypt coded messages, or run computationally expensive simulations (yes, some people actually do these things as hobbies), then you need the processor power. But it's also nice to have a processor for your OS to run on while something else you're doing, like a compiling X or OpenOffice, is running in the background, so that you don't experience noticable system performance degredation. ;-) Actually, if there exists a cheap, reliable MP Athlon mobo, I'll probably do just that. Remember, it's great for encoding/decoding things like mp3s and DVDs... And because it would make Q3a positively sing on my Linux box. But truthfully I wouldn't buy it because I *need* the processor power. I'd do it just because it's damn cool. =8^) What I really, really want is a dual athlon laptop with 1GB RAM and a 64MB NVidia GeForce4 440 Go with 1600x1200 LCD panel. I'll keep dreaming... - -- Derek Martin [EMAIL PROTECTED] - - I prefer mail encrypted with PGP/GPG! GnuPG Key ID: 0x81CFE75D Retrieve my public key at http://pgp.mit.edu Learn more about it at http://www.gnupg.org -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8xNIvdjdlQoHP510RAm5mAKCTadnjE2kdUtMe1wbmFEsQbgQQsQCfS5a2 MMd0hwGKmDjcm705dGc08nI= =S3YX -END PGP SIGNATURE- * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
[no subject]
Testing
Re: Another (simpler) bash scripting question...
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 At some point hitherto, Kevin D. Clark hath spake thusly: result=badness# init with failure default spewSomeKindOfOutput | while read input do result=goodness done echo $result What is the output? In general, the inner part of the loop is run in a sub-shell. Not exactly... it's more subtle even than that. For example: result=badness# init with failure default while read input do result=goodness done echo $result What is the result in this case? The shell script outputs goodness instead of badness as in the previous example. Certain kinds of things trigger the shell to use a subshell for loops. One is, as in the example above, piping the output of a process into another command. Another is if you redirect the output of the loop into a file, as in done $ouputfile In the former case, I believe it does so because the shell which the script is running in must first fork a process to generate the output, and fork a second process (a shell) to feed the output of that command to through a pipe (as in pipe(2)). I believe this is necessary because the stdout and stdin of the processes which the shell runs are not the same as those of the shell itself. I'm not quite positive on that, and hopefully someone will correct me if I'm mistaken. The latter case would essentially be the same thing; the shell the loop is running in has a different stdout than the shell script itself, so it must fork a subshell in order to change where stdout goes for the subprocess without changing it for the parent. I think the redirection would look something like this: s = fork(); if (!s){ fd = open(outputfile, blah); dup2(fd, 1); execv(/usr/bin/bash, /usr/bin/bash, blah blah blah); } /* continue processing the rest of the shell script */ In my minor rewrite of Mike's example, this isn't necessary, because stdout, stdin, and stderr haven't been redirected (nor crammed into a pipe), but are all the same in the loop as for the rest of the shell script. - -- Derek Martin [EMAIL PROTECTED] - - I prefer mail encrypted with PGP/GPG! GnuPG Key ID: 0x81CFE75D Retrieve my public key at http://pgp.mit.edu Learn more about it at http://www.gnupg.org -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8xNm+djdlQoHP510RAnrZAJ97gDtySuBILkhU6HEJTwiXLEQlFQCghMYN h2WnKkdUxE4MFaKl6a7kcgc= =594z -END PGP SIGNATURE- * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Re: Another (simpler) bash scripting question...
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 At some point hitherto, Benjamin Scott hath spake thusly: If portability is a concern, depending on the environment, it is sometimes easier to install the GNU tools everywhere than try to craft something that works on all the native tools. Excellent point! I know people who do this for that very reason... - -- Derek Martin [EMAIL PROTECTED] - - I prefer mail encrypted with PGP/GPG! GnuPG Key ID: 0x81CFE75D Retrieve my public key at http://pgp.mit.edu Learn more about it at http://www.gnupg.org -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8xNoOdjdlQoHP510RAp9zAKCKil4S2SNii5Bp1O67kTbYGiRD9QCgpuDg PNA0nUA89NOXMvCWEnHuZKU= =Jmt6 -END PGP SIGNATURE- * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *
Forever i havent been able to send GNHLUG
Forever i havent been able to send GNHLUG news to gnhlugbefore the messages where coming in as [EMAIL PROTECTED] as an alias but i wastrying to send as [EMAIL PROTECTED]... to try to fix my sending problem i made an account in GNHLUG as postmasterSo Now It Works!YOU MUST SEND THE MESSAGE TO [EMAIL PROTECTED] AS THE EMAIL ACCOUNT YOUSIGNED UP WITH! Aleander Delmore / AKA Fibre P.S. please Take off [EMAIL PROTECTED] from the list
unsubscribe gnhlug
unsubscribe gnhlug * To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *