what does <<! mean on the end of a command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting what does <<! mean on the end of a command
# 1  
Old 03-22-2005
what does <<! mean on the end of a command

Hi, just a quick question really on what the <<! at the end of a line actually means ? as you can see i have an oracle startup script that has an sqlplus command. im making a guess here, so correct me if im wrong but the "startup" and "exit" commands that follow are sqlplus command and not unix commands, so i am i right in saying the <<! basically allows app specific commands to follow ??

PS , I cant test this because its a production environment



Code:
#!/bin/bash
cd /export/home/oracle
. oracle9.env
sqlplus "sys/password as sysdba" <<!
startup
exit

# 2  
Old 03-22-2005
You are correct. It's called a here document, which does special I/O redirection to the interactive program, in this case sqlplus. Read more about it http://www.faqs.org/docs/abs/HTML/here-docs.html
# 3  
Old 03-22-2005
thanks for that, just one more question , the link you posted has a << and then the command to send, but what does the "!" do at the end?
# 4  
Old 03-22-2005
I'm sure at some point later in your script you will see a line with a "!" in it. The way the here document works, you can basically put anything there -- you just need to tell the shell where it begins and where it ends. For example you could just as easily have done this:
Code:
#!/bin/bash
cd /export/home/oracle
. oracle9.env
sqlplus "sys/password as sysdba" <<THISISAHEREDOC
startup
exit
THISISAHEREDOC

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed command to append word at end of line

hello Team, I am looking for sed command or script which will append word at end of line. for example. I want to validate particular filesystem with mount |<filesystem name> command. if nodev parameter is not there then it should add in the fstab file with receptive to the filesystem. # mount... (8 Replies)
Discussion started by: ghpradeep
8 Replies

2. Shell Programming and Scripting

Getting the Start, End time and duration using date command

Oracle Enterprise Linux We want to track how long a process takes to complete its execution. This is what we want in the schell script Before the process is started , get the time with date, hours and minutes execute the process After the process has ended , get the time with date,... (5 Replies)
Discussion started by: omega3
5 Replies

3. Shell Programming and Scripting

Unable to set end of line in mail command

Hi , Am trying to send mail using the mail command, but the mail command is working but its not sending automatically after pressing .(dot) in the command prompt it sends . How to achieve that. Also it showing the below line after pressing the dot . /home/abc1/dead.letter... Saved message in... (5 Replies)
Discussion started by: rogerben
5 Replies

4. UNIX for Dummies Questions & Answers

Replace backslash at the end of the string using sed command

I have text file which is a tab delimited one. Sample data from the file is shown below: unix is\ great\ os linux\ is superb I want to replace that backslash with empty string preserving the tab delimiter. Output should be unix is great os linux is ... (3 Replies)
Discussion started by: p.akhilreddy4u
3 Replies

5. Shell Programming and Scripting

Using sed command to change end of line

I am looking to change a data file into a javascript string and this is the code that I am using: sed -i '' -e 's/^/str += "/' -e 's/$/";/' file.xml The first part -e 's/^/str += "/' works as intended, but the second part -e 's/$/";/' adds an additional newline to my file, so that instead of... (3 Replies)
Discussion started by: figaro
3 Replies

6. Programming

unexpected 'end of file' + sed command

hello, i use this command in my code: (void) sprintf ( LBuf, "/bin/sed 's/\\//g' %s > %s", tmp1,tmp2); but i get this error : sh: syntax error at line 1:'end of file' unexpected any help please thank you (1 Reply)
Discussion started by: kamel.seg
1 Replies

7. AIX

CUT command - cutting characters from end of string

Hello, I need to delete the final few characters from a parameter leaving just the first few. However, the characters which need to remain will not always be a string of the same length. For instance, the parameter will be passed as BN_HSBC_NTRS/hub_mth_ifce.sf. I only need the bit before the... (2 Replies)
Discussion started by: JWilliams
2 Replies

8. Shell Programming and Scripting

Command to add 1000 spaces to end of line

hi, could anyone tell me the command to append spaces at the end of the line. for example, i need 1000 spaces after the word "helloworld" echo "helloworld " i need to achieve this in someother way hardcoding 1000 spaces is not practical. as i am totally new... (3 Replies)
Discussion started by: kavithacs
3 Replies

9. UNIX for Dummies Questions & Answers

add data from command line to end of file

how can I add data from command line to end of file? (3 Replies)
Discussion started by: bryan
3 Replies

10. UNIX for Dummies Questions & Answers

End of file using more command

How do I get to the end of a file using the more command i.e. more filename (I want to stay in the file, but don't want to have to do Shift + G to get to the end, as I want the command set up as a short cut. I want to more the end of the file rather than the start but stay within the file) (3 Replies)
Discussion started by: Enda Martin
3 Replies
Login or Register to Ask a Question