Re: Simple Unix script..but goes awry
From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 05/19/04
- Next message: Stephane CHAZELAS: "Re: POSIX SHELL : multiple line variable"
- Previous message: Icarus Sparry: "Re: Debugging bash startup"
- In reply to: BenJose: "Simple Unix script..but goes awry"
- Next in thread: BenJose: "Re: Simple Unix script..but goes awry"
- Reply: BenJose: "Re: Simple Unix script..but goes awry"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 19 May 2004 02:02:55 -0400
In article <621f2639.0405181907.1eefe86@posting.google.com>,
benjose@hotmail.com (BenJose) wrote:
> Hi!
>
> Here is a simple Unix script that I used to insert the contents of a
> log file into an Oracle db.
>
> #!/bin/sh
> FILE1=tst.txt
> echo $FILE1
> rm tmp.sql
> $MSG=`cat $FILE1`
> echo $MSG
> echo "insert into DLY_MSGS values(SYSDATE,'"$MSG"'); \n commit; \n q
> uit;">tmp.sql
> cat tmp.sql
> /export/apps/oracli/mplus/9.2.0/bin/sqlplus debdwc/debdwc@DOEBODS1
> @tmp.sql
> ~
> ~
>
> Now the 'cat' command does'nt just get the contents of the file, but
> also goes into an infinite loop doing a 'ls' on the current
> directory... Any pointers... or any suggestions...
Are you sure it's not the "echo" command that's doing that? Does
changing it to:
echo "$MSG"
fix it? If so, I'll bet that tst.txt contains globbing characters.
-- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***
- Next message: Stephane CHAZELAS: "Re: POSIX SHELL : multiple line variable"
- Previous message: Icarus Sparry: "Re: Debugging bash startup"
- In reply to: BenJose: "Simple Unix script..but goes awry"
- Next in thread: BenJose: "Re: Simple Unix script..but goes awry"
- Reply: BenJose: "Re: Simple Unix script..but goes awry"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|