- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Shell Scripts
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
тАО10-09-2008 09:49 AM
тАО10-09-2008 09:49 AM
I was thinking to learn Shell Scripting now.
I have found this wonderful document in the forum:-
http://forums12.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1223574328053+28353475&threadId=178514
How to run a shell script...
Is it like ftp these scripts to the server and do
#sh <scriptname>.sh
or copy and paste the content to the root prompt...
I have done some C programming in school.. but i'm not sure if that would make my job easire..
And If I want to run some simple scripts at the root prompt.. how can I do that..
Thank you
Solved! Go to Solution.
- Tags:
- broken URL link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2008 09:52 AM
тАО10-09-2008 09:52 AM
SolutionThe one thing I ALWAYS forget is the "shabang" at the beginning on the shell script, the #!/usr/bin/sh or whatever. Do you have a particular goal in mind for your scripts or just trying to learn?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2008 09:58 AM
тАО10-09-2008 09:58 AM
Re: Shell Scripts
Initially I want to start of with simple scripts like... to create a VG00 or VG01 ... instead of typing the commands everytime... I want to keep a script handy so that whenever needed I will do #sh <scriptname>.sh and the VG is created.
I dont know what else could be an example...
So was just trying to learn... may be in my next project I will have to use...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2008 09:59 AM
тАО10-09-2008 09:59 AM
Re: Shell Scripts
> I was thinking to learn Shell Scripting now...
Very good. *EVERY* good Unix administrator should be able to do basic shell programming at a minimum.
> I have done some C programming in school.. but i'm not sure if that would make my job easire..
Maybe yes; maybe no. Do *NOT* be tempted to extrapolate this into choosing the C-shell! You need to use and learn the POSIX shell --- '/usr/bin/sh' or '/sbin/sh' in our world.
> And If I want to run some simple scripts at the root prompt.. how can I do that..
NO, NO, NO! Work in your own non-root account and learn the pitfalls there, unless, of course, you have good Ignite backups and can afford to rebuild your server after you remove things!
You might start by reading:
http://docs.hp.com/en/B2355-90046/index.html
http://www.shelldorado.com/
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2008 09:59 AM
тАО10-09-2008 09:59 AM
Re: Shell Scripts
(root) # vi /home/user1/myscript
...
write your script here and save & exit
...
(root) # chmod o+rwx /home/user1/myscript
(root) # /home/user1/myscript
this should be all
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2008 10:01 AM
тАО10-09-2008 10:01 AM
Re: Shell Scripts
http://www.shelldorado.com/
lots of tips / best practices / articles
while learning, i would be logged in as root, as a mistake can trash the system. much better to set up a login for a normal user and use that.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2008 10:20 AM
тАО10-09-2008 10:20 AM
Re: Shell Scripts
/usr/bin/rsh: /home/vamsi/.logout: The operation is not allowed in a restricted
shell.
$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2008 04:02 PM
тАО10-09-2008 04:02 PM
Re: Shell Scripts
Why would you want to do that (add w)?
chmod a+rx /home/user1/myscript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2008 07:38 AM
тАО10-10-2008 07:38 AM
Re: Shell Scripts
/usr/bin/rsh: /home/vamsi/.logout: The operation is not allowed in a restricted
shell.
$"
So? Why is the account running rsh?
I assume this is the account that you set up for yourself so you could play with scripts, is it not? (as usual, no information)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2008 07:47 AM
тАО10-10-2008 07:47 AM
Re: Shell Scripts
$ exit
/usr/bin/rsh: /home/vamsi/.logout: The operation is not allowed in a restricted
shell.
$
Also what does the below mean
$ /usr/local/bin/sudo su-
sudo: /usr/local/etc/sudoers is mode 0666, should be 0440