- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script help me(about EOF)
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2009 10:40 PM
тАО12-01-2009 10:40 PM
Script help me(about EOF)
I have a question for script.
my shell is csh and os is hp-ux 11.23
i have a sript file as like:
#!/usr/bin/csh
CELLtalk -n YT5_MBX << 'EOF'
du *
'EOF'
how to run on to command-line?
For example)
$>CELLtalk -n YT5_MBX << 'EOF' \n du * \n 'EOF'
right my syntex?
But i could not get any results.
Please let me know...
have a good time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2009 10:53 PM
тАО12-01-2009 10:53 PM
Re: Script help me(about EOF)
You should give up on the scummy C shell and switch to a real shell: ksh or sh
CELLtalk -n YT5_MBX << 'EOF'
du *
'EOF'
This looks like a here document. What are you intending to do with "du *"? Those single quotes don't look correct, try:
CELLtalk -n YT5_MBX <
EOF
- Tags:
- scummy C shell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2009 11:16 PM
тАО12-01-2009 11:16 PM
Re: Script help me(about EOF)
Thats right.
I perceive that I have used single quotes.
Dose not run on to command line in Cshell?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2009 12:55 AM
тАО12-02-2009 12:55 AM
Re: Script help me(about EOF)
http://forums13.itrc.hp.com/service/forums/helptips.do?#33
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2009 01:00 AM
тАО12-02-2009 01:00 AM
Re: Script help me(about EOF)
Do you know why you used quotes?
>Does not run on to command line in cshell?
No, you must have here documents on following lines.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2009 01:21 AM
тАО12-02-2009 01:21 AM
Re: Script help me(about EOF)
>Do you know why you used quotes?
i've found it on the website.
>No, you must have here documents on following lines.
where is following lilnes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2009 03:44 AM
тАО12-02-2009 03:44 AM
Re: Script help me(about EOF)
even in csh the command in your script is not different to that in interactive mode:
nik@hpx6[200] csh
hpx6% cat >/tmp/xx <
b
EOF
hpx6% cat /tmp/xx
a
b
hpx6%
The tcsh used a secondary prompt '?' as default:
cat >/tmp/xx <
? b
? EOF
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2009 11:37 AM
тАО12-02-2009 11:37 AM
Re: Script help me(about EOF)
> >Dennis: No, you must have here documents on following lines.
where is following lilnes?
What is meant is that the body (lines) of the "here-document" must be written on lines that are separate from the '<<[-]word' line.
You could type these three lines:
# cat <<'EOF'
> today is $(date)
> EOF
today is $(date)
#
...As you know, when you type "EOF" and hit the keyboard ENTER or RETURN key, the string "today is..." is returned.
If you want command-substitution too, don't quote the here-document end-marker (the 'EOF') like this:
# cat <
> EOF
today is Wed Dec 2 14:29:08 EST 2009
#
...Now, if you want to edit the document without retyping, recall it (esc+K) in a Korn or Posix shell and use the 'vi' editor to change it:
# cat <
#
The "^J" sequences represent newline sequences generated by pressing the return/enter key or by pressing the Control-key, a lowercase "v", and then a lowercase "j".
Regards!
...JRF...
- Tags:
- command substitution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-03-2009 01:30 AM
тАО12-03-2009 01:30 AM
Re: Script help me(about EOF)
It appears it works similarly to a real shell except you don't quote the "word" at the end of the document.
>JRF: If you want command-substitution too, don't quote the here-document end-marker
It may be easier to use "\" to quote it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-03-2009 01:51 AM
тАО12-03-2009 01:51 AM
Re: Script help me(about EOF)
command <<< "what the input should be"
For example:
CELLtalk -n YT5_MBX <<< "`du *`"
I'm not sure if this will work in CSH thou.
Best regards
Fredrik Eriksson