Sponsored Content
Top Forums UNIX for Advanced & Expert Users Seek UNIX script tutor and help Post 302194099 by era on Monday 12th of May 2008 08:25:41 AM
Old 05-12-2008
You are using <<EOF "here documents" without a closing EOF terminator. The whole remainder of the script gets passed to SQL (which ignores it, if it doesn't outright choke on it).

The "exit" is apparently not really supposed to be there? If it is, that's where the script terminates.

The "here document" syntax is a bit hard to grok until you get the hang of it. Maybe a few examples can help.

Code:
cat <<END_OF_FIRST_HERE_DOCUMENT

This will be copied to standard output
including this part which really looks a lot like a shell script
#!/bin/sh
echo frnod
exit 255
This is all just text as far as the shell is concerned,
so we don't care even that this looks like an unterminated
single-quoted string (because of the single quote between "don" and "t").
END_OF_FIRST_HERE_DOCUMENT

echo Script execution continues here

cat <<!
Another here document
you can use almost anything as a terminator
!

echo Back to the studio
exit 0

 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Why script For...Loop doesn't work. Seek help

I have written a script to run on UNIX server. When I tested, it always hanged on after "date +"%D %T: XXXXXX script started." part. Then it wouldn't go further. UNIX server gave me one error message. I used the same code in another script. It works fine. I think the major problem may be in... (3 Replies)
Discussion started by: duke0001
3 Replies

2. Solaris

Solaris 10 Tutor

I am looking to enter into the IT field and i'm very interestd in the Solaris 10 OS. Apart from shelling out outrageous sums to companies based here in the UK, I would appreciate any other advise on how to go about studying, understanding and certifiying in Solaris 10. I have tried to install... (1 Reply)
Discussion started by: kress2m1
1 Replies

3. AIX

server seek internet

hello i'm working with aix 5.3 hacmp 5.4 P550 and P520 those two serevr every 10 seconds seek connection to the internet web. i check with sniffer software and i've got this details. the problem is that when i've problem with the internet those server get frizzzzzzz. on those servers running... (0 Replies)
Discussion started by: ariec
0 Replies

4. UNIX for Advanced & Expert Users

dd seek problem

I want to seek to a location on the hard drive that will be written to that is different from the output block size. Is this possible? It seems the man page implies you can only seek in increments of the number of bytes you output. A bit of information about what I'm trying to do, if that... (6 Replies)
Discussion started by: silvermoon
6 Replies

5. UNIX for Dummies Questions & Answers

Seek help configuring Sendmail 8.14.4 Unix

Seek help configuring Sendmail 8.14.4 Unix server. Not sure if this is the correct place to post or the Unix/Linux Forums job board. Seeking help configuring sendmail 8.14.4 on my Unix server. It appears I have an open relay. I was advised I need to modify a etc/mail/dir , a command line entry... (0 Replies)
Discussion started by: raecampus
0 Replies

6. Emergency UNIX and Linux Support

Seek help on shell script syntax errors

I want to delete archivelog files that has been archived and applied from primary database to standby database. This piece of script is working in Linux server. However, I copy it to Unix server with tiny modification. It won't work and generate the error message. I have checked code carefullt... (8 Replies)
Discussion started by: duke0001
8 Replies

7. Shell Programming and Scripting

Tutor or help needed (online)

Hi, i like to know if any of the forum member happens to know any good tutor who is willing to provided on-line help to my scripting skills? jared (5 Replies)
Discussion started by: Jared
5 Replies
SCRIPT(1)						    BSD General Commands Manual 						 SCRIPT(1)

NAME
script -- make typescript of terminal session SYNOPSIS
script [-a] [-f] [-q] [-t] [file] DESCRIPTION
Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1). If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript. Options: -a Append the output to file or typescript, retaining the prior contents. -f Flush output after each write. This is nice for telecooperation: One person does `mkfifo foo; script -f foo' and another can super- vise real-time what is being done using `cat foo'. -q Be quiet. -t Output timeing data to standard error. This data contains two fields, separated by a space. The first field indicates how much time elapsed since the previous output. The second field indicates how many characters were output this time. This information can be used to replay typescripts with realistic typing and output delays. The script ends when the forked shell exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-d (if ignoreeof is not set) for the C-shell, csh(1)). Certain interactive commands, such as vi(1), create garbage in the typescript file. Script works best with commands that do not manipulate the screen, the results are meant to emulate a hardcopy terminal. ENVIRONMENT
The following environment variable is utilized by script: SHELL If the variable SHELL exists, the shell forked by script will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most shells set this variable automatically). SEE ALSO
csh(1) (for the history mechanism), replay(1). HISTORY
The script command appeared in 3.0BSD. BUGS
Script places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects. Linux July 30, 2000 Linux
All times are GMT -4. The time now is 04:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy