I don't understand why this code isn't working

I don't understand why this code isn't working

Post by Dafel » Thu, 10 Jun 2004 21:59:28



*** Everything seems to work from here to where my spool file is
created in the *** sql.

# Check for old file - remove if found
if [ -f /var/voice/voicecleanup.txt ]
then
        rm /var/voice/voicecleanup.txt

fi

        # Logon tp SQLplus, Run Sql file
        sqlplus -s username/password<<END

          quit
          END

 **** This is where the code fails. All code after the above line
never executes. What am I doing wrong

# Clean up spool file
sed -e 's/^[ \t]*//;s/[ \t]*$//' -e '/^$/d' -e '$d' voicecleanup.lst

Quote:>> voicecleanup.txt

          echo '.EOF' >> voicecleanup.txt
 
 
 

I don't understand why this code isn't working

Post by Ed Morto » Thu, 10 Jun 2004 22:42:41



> *** Everything seems to work from here to where my spool file is
> created in the *** sql.

> # Check for old file - remove if found
> if [ -f /var/voice/voicecleanup.txt ]
> then
>         rm /var/voice/voicecleanup.txt

You could just do "rm -f /var/voice/voicecleanup.txt" instead of the
separate test.

> fi

>         # Logon tp SQLplus, Run Sql file
>         sqlplus -s username/password<<END

>           quit
>           END

>  **** This is where the code fails. All code after the above line
> never executes. What am I doing wrong

You need to put the "END" for the end of the here document at the start
of the line, or prefix it with a "-" at the start of the here document.

        Ed.

 
 
 

I don't understand why this code isn't working

Post by Stephane CHAZELA » Thu, 10 Jun 2004 23:55:03


2004-06-09, 08:42(-05), Ed Morton:


[...]
>> # Check for old file - remove if found
>> if [ -f /var/voice/voicecleanup.txt ]
>> then
>>         rm /var/voice/voicecleanup.txt

> You could just do "rm -f /var/voice/voicecleanup.txt" instead of the
> separate test.

You might end up removing a voicecleanup.txt file that is not a
regular one (or a symlink to a regular file).

--
Stephane

 
 
 

I don't understand why this code isn't working

Post by Goran Larss » Thu, 10 Jun 2004 22:46:00




>         sqlplus -s username/password<<END

>           quit
>           END

Read the shell manpage about '<<'. The terminating 'END' must
match the 'END' after '<<' exactly. The indentation prevents
the match and the rest of the file is consumed by '<<' instead
of being executed.

|        sqlplus -s username/password<<END

|           quit
|END

--
G?ran Larsson     http://www.mitt-eget.com/

 
 
 

I don't understand why this code isn't working

Post by Bill Marcu » Thu, 10 Jun 2004 23:13:18


On 9 Jun 2004 05:59:28 -0700, Dafella

> *** Everything seems to work from here to where my spool file is
> created in the *** sql.

>         # Logon tp SQLplus, Run Sql file
>         sqlplus -s username/password<<END

>           quit
>           END

>  **** This is where the code fails. All code after the above line
> never executes. What am I doing wrong

Don't indent the END.  Or, if you do indent it, change <<END to <<-END
and use tabs, not spaces.

--
Simulations are like miniskirts, they show a lot and hide the essentials.
                -- Hubert Kirrman

 
 
 

I don't understand why this code isn't working

Post by Villy Krus » Fri, 11 Jun 2004 00:02:04


On Wed, 9 Jun 2004 14:55:03 +0000,

> 2004-06-09, 08:42(-05), Ed Morton:

> [...]
>>> # Check for old file - remove if found
>>> if [ -f /var/voice/voicecleanup.txt ]
>>> then
>>>         rm /var/voice/voicecleanup.txt

>> You could just do "rm -f /var/voice/voicecleanup.txt" instead of the
>> separate test.

> You might end up removing a voicecleanup.txt file that is not a
> regular one (or a symlink to a regular file).

test -f symlink will return true if the symlink refers to a regular file.
You need test -h to explicit test for symlink.

Villy

 
 
 

I don't understand why this code isn't working

Post by Stephane CHAZELA » Fri, 11 Jun 2004 01:08:12


2004-06-09, 15:02(+00), Villy Kruse:
[...]

Quote:>> You might end up removing a voicecleanup.txt file that is not a
>> regular one (or a symlink to a regular file).

> test -f symlink will return true if the symlink refers to a regular file.
> You need test -h to explicit test for symlink.

That's what I meant.

rm -f voicecleanup.txt
will remove the voicecleanup.txt if it is neither a regular file
nor a symlink to a regular file.

--
Stephane

 
 
 

I don't understand why this code isn't working

Post by Kevin Colli » Fri, 11 Jun 2004 06:48:54




>> *** Everything seems to work from here to where my spool file is
>> created in the *** sql.

>> # Check for old file - remove if found
>> if [ -f /var/voice/voicecleanup.txt ]
>> then
>>         rm /var/voice/voicecleanup.txt

> You could just do "rm -f /var/voice/voicecleanup.txt" instead of the
> separate test.

>> fi

>>         # Logon tp SQLplus, Run Sql file
>>         sqlplus -s username/password<<END

>>           quit
>>           END

>>  **** This is where the code fails. All code after the above line
>> never executes. What am I doing wrong

> You need to put the "END" for the end of the here document at the start
> of the line, or prefix it with a "-" at the start of the here document.

The "-" only works when you use ONLY tabs as whitespace before the EOF. That is
based on both ksh and bash man pages (and my experience)...

Kevin

 
 
 

1. samba's nmdb isn't working - why?

Hi,

I have got a serious problem with samba 2.0.2 running on a freebsd 3.1
box. I use the freebsd box as a gateway and file server for a lan with
two win 95 machines and one wfg machine. After installation and making
smb.conf I thought everything is all right, but it wasn't. The problem
was that sometimes the freebsd box was seen in the network neighborhood,
sometimes it was not. I discovered that nmbd stopped working sometimes,
often after a client booted. So this maybe the reason why the bsd box
isn't seen (The bsd box is set as local master and preferred master with
os level 65 to win the election to be the local master browser and act
also as a wins server. But a change of this wouldn't solve the problem.)

In the boot messages was a line which said nmbd aborts because of signal
6 without any further reasons (and I'm new to freebsd so I don't know
how to increase the debug level of the boot messages to get further
information). In the nmbd log was nothing special, althought I decrease
the debug level. Only a messages that nmbd isn't abel to sync the browse
list with an domain master browser was shown which doesn't exit (debug
level 3). swat tells me that the file /var/spool/loch/STATUS.LCK isn't
found, but with this information I can't do anything. I do not
understand it.

A last I install the package new after uninstalling it - now nmbd starts
anymore!! It wouldn't be that problem because I can connect with net use
from the windows 95 clients, but this don't work from the wfg client!!

So if there is any help or advice I would really appreciate it, because
this problem drives my really crazy

peter

  vcard.vcf
< 1K Download

2. suse / advansys.o question

3. 'make' fails, and I don't understand the error msg

4. MPC7400, L2 Cache, Copy back Data and instruction enable.

5. I don't understand the '\'

6. perl

7. Don't understand why wjbell is here.

8. Video-Cam support with Linux?

9. Windows for people who don't want to know why it doesn't work?

10. Questions on this setup - don't understand why this is what it is.

11. 'batch' and 'at' don't work

12. 'make' and 'gcc' don't work

13. 'stty -opost' or 'stty -onlcr' don't work ?!