GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: multiple shell command interpreter on script.....
Operating System - HP-UX
1848010
Members
8700
Online
104022
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
07-20-2005 01:58 PM
07-20-2005 01:58 PM
guys,
I'm planning to create a large shell script but it require multiple language/module such as expect & perl within the ksh... Should i put any extra expression on the header of my script....
I'm planning to create a large shell script but it require multiple language/module such as expect & perl within the ksh... Should i put any extra expression on the header of my script....
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2005 02:06 PM
07-20-2005 02:06 PM
Solution
No, you can only have one she-bang at the top of the script.
Your best bet would be to call other scripts from within the main script.
For example:
# cat mainscript.sh
#!/usr/bin/sh
...Do some stuff...
/dir/script.expect
...Do some other stuff...
/dir/script1.perl
...Do some more stuff...
# cat script.expect
#!/path/to/expect
Do some expect stuff......
# cat script1.perl
#!/path/to/perl
Do some perl stuff.....
Your best bet would be to call other scripts from within the main script.
For example:
# cat mainscript.sh
#!/usr/bin/sh
...Do some stuff...
/dir/script.expect
...Do some other stuff...
/dir/script1.perl
...Do some more stuff...
# cat script.expect
#!/path/to/expect
Do some expect stuff......
# cat script1.perl
#!/path/to/perl
Do some perl stuff.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2005 02:32 PM
07-20-2005 02:32 PM
Re: multiple shell command interpreter on script....
Will something like this help:
echo task1 | sh
#To be executed by sh
echo task2 | bash
#To be executed by bash
echo task3 | ksh
#To be executed by korn shell
echo task1 | sh
#To be executed by sh
echo task2 | bash
#To be executed by bash
echo task3 | ksh
#To be executed by korn shell
Vibhor Kumar Agarwal
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP