From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "McCracken, Denise" Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: User timeouts Date: Thu, 10 Apr 2003 12:47:12 -0700 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <21C552CF85C64D4A891D47E7A33274A8048E2EBF@EXBRDY.sunquest.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1050004078 15882 80.91.224.249 (10 Apr 2003 19:47:58 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 10 Apr 2003 19:47:58 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Thu Apr 10 21:47:56 2003 Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.22.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 193i1b-000480-00 for ; Thu, 10 Apr 2003 21:47:55 +0200 Original-Received: (qmail 21082 invoked by uid 5); 10 Apr 2003 19:48:16 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 21066 invoked by uid 49493); 10 Apr 2003 19:48:16 -0000 Original-Received: from Denise.McCracken@misyshealthcare.com by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.54. spamassassin: 2.50-cvs. Clear:SA:0(-1.2/5.0):. Processed in 0.585779 secs); 10 Apr 2003 19:48:16 -0000 Original-Received: from unknown (HELO emroute2.cind.ornl.gov) (160.91.86.17) by 0 with SMTP; 10 Apr 2003 19:48:15 -0000 Original-Received: from emroute2.cind.ornl.gov (LOCALHOST [127.0.0.1]) by emroute2.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HD500A498CEKL@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 10 Apr 2003 15:48:14 -0400 (EDT) Original-Received: from eximsbrdy.sunquest.com (eximsbrdy.hosp.misyshealthcare.com [149.138.1.1]) by emroute2.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HD500LFX8C7V5@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 10 Apr 2003 15:48:08 -0400 (EDT) Original-Received: by eximsbrdy.sunquest.com with Internet Mail Service (5.5.2656.59) id ; Thu, 10 Apr 2003 12:48:02 -0700 Content-return: allowed Original-To: tru64-unix-managers@ornl.gov X-Mailer: Internet Mail Service (5.5.2656.59) Xref: main.gmane.org gmane.os.tru64.managers:3946 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:3946 Thanks fo Jay Wren, Jim Fitzmaurice, Michael Deacy, Bruce Hines, David DeWolfe and anyone i've missed. The solution is, for ksh, set the enviro TMOUT=3Dn where n is in = seconds. For /sbin/sh, the variable is TIMEOUT and is in minutes. -Denise -----Original Message----- From: Jean-Fran=E7ois Blanchet [mailto:Jfblanchet@dgeq.qc.ca] Sent: Monday, March 31, 2003 12:11 PM To: tru64-unix-managers@ornl.gov Subject: SUMMARY: script for replacing Null character in files My question: I want to find and replace ascii character 00 by blank in file. I have 125 files to do. Can you give me a solution with unix utilities? Solutions: A lot of good responses, but I have use this one: perl -pi -e 's/\x00/ /g;' filename Using wildcards in the filename is valid, too. ------------------------------------------------------------------ for i in ; do tr "\0" " " <$i >$i.nonul; cp $i.nonul $i; rm = -f $i.nonul; done; ------------------------------------------------------------------ foreach x (*) echo $x cat $x | tr '\000' ' ' > ${x}.NEW mv $x.NEW $x end ------------------------------------------------------------------ /* chnulltoblank.c P. Farrell, Jan 15, 2003 Program to read std input, translate all null characters (\000) to blanks, and write to standard output. Compile with: cc -o chnulltoblank chnulltoblank.c Use like this: chnulltoblank < inputfile > outputfile */ #include main() { char ch =3D '\0'; char null =3D '\0'; char blank =3D ' '; while((ch =3D getc(stdin)) !=3D EOF) { if( ch !=3D null ) putc(ch,stdout); else putc(blank,stdout); } /* end of read loop */ fclose(stdout); /* so next program in pipe sees EOF properly */ } ------------------------------------------------------------------------= ---- ------------ =20