- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- What does #!/bin/sh at the beginning of a file do?
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
тАО02-12-2003 03:22 AM
тАО02-12-2003 03:22 AM
#!/bin/sh
or
#!/bin/ksh
makes sure the script is run using the shell referenced in the first line? I.e. if the user is using ksh, it will over-ride ksh and execute the script as a sh script (or vice-versa).
Thanks,
Gary Cooper
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2003 03:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2003 03:27 AM
тАО02-12-2003 03:27 AM
Re: What does #!/bin/sh at the beginning of a file do?
#! is a magic macro which at the beginning of a shell script will make the shell script executed by the specified shell.
eg:-
#!/bin/ksh
ls
the above shell script will use ksh shell to run ls command.
regards,
U.SivaKumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2003 03:34 AM
тАО02-12-2003 03:34 AM
Re: What does #!/bin/sh at the beginning of a file do?
The HP ITRC user forum really is great!
Regards,
Gary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2003 03:35 AM
тАО02-12-2003 03:35 AM
Re: What does #!/bin/sh at the beginning of a file do?
#!/usr/bin/perl -w
#!/usr/bin/sh
#!/usr/bin/awk
#!/home/user/scripts/myscript -x -duh
etc
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2003 06:32 AM
тАО02-12-2003 06:32 AM
Re: What does #!/bin/sh at the beginning of a file do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2003 07:24 AM
тАО02-12-2003 07:24 AM
Re: What does #!/bin/sh at the beginning of a file do?
'shebang' so if you ever hear someone say it, it doesn't mean magic. Magic is altogether different and we have "magic numbers" and "magic cookies" and no I am not pulling your leg.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2003 07:29 AM
тАО02-12-2003 07:29 AM
Re: What does #!/bin/sh at the beginning of a file do?
Cheers,
Gary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2003 12:31 PM
тАО02-13-2003 12:31 PM
Re: What does #!/bin/sh at the beginning of a file do?
It was orignally called "hashpling". See:
http://www.uni-ulm.de/~s_smasch/various/shebang/