1753274 Members
5038 Online
108792 Solutions
New Discussion юеВ

sh program

 
sandeep_27
New Member

sh program

I am novice in UNIX can someone give me a sh shell program for the above question?
4 REPLIES 4
Muthukumar_5
Honored Contributor

Re: sh program

sandeep,

where is your shell program question?
Easy to suggest when don't know about the problem!
Shaikh Imran
Honored Contributor

Re: sh program

Hi Sandeep,

Welcome to the forums.
Your question is either incomplete or not clear..
Could you please clear it.

Regards,

I'll sleep when i am dead.
Bharat Katkar
Honored Contributor

Re: sh program

Sandeep,
Didn't get your question exactly.
Well, all unix flavors comes with some default shells with them, like HPunix has POSIX as default shell, SCOunix comes with Bourne Shell as default shell, and so on..
What you want i guess is the program i.e. sh program as your subject is saying which is nothing but the script.

# sh program

Now this program is the script written as per the syntax of that particular shell e.g. script written for POSIX shell could be different than written for bourne or Korn shell.

If you want to know what shell your UNIX has and like to learn more about it then do this:

1. # env | grep SHELL
It will display "/usr/bin/sh" if it is POSIX
2. # man sh-posix
Go thr' the man pages thoroughly and you will be able to write script for Posix shell.
3. # chmod +x program
Now assuming you have written a script with name "program", you have to change it's mode to executable as shown above.
4. # sh program
Now this is how you can execute your program i.e. script.

Hope i understood you and you understood me. :))

All the best.
Regards,

You need to know a lot to actually know how little you know
Muthukumar_5
Honored Contributor

Re: sh program

Even though, i did not get question reply, let's go with on sh program now.

UNIX are allocating shell to execute commands to interact kernel for the execution of that command.

shell programming are used to combine sequence of shell commands / conditionals / etc in a file and execute them there.

Different kind of shells are available as,
sh(rsh),sh-posix,ksh(rksh),csh,tcsh,bash ( advanced one )

See man page for sh, sh-posix there as,
man sh
man sh-posix

Easy to suggest when don't know about the problem!