Linux – How to write shell scripts in Sun Solaris

command-line-interfacelinuxsolarisUbuntu

I am new to Unix shell scripting. So can anybody help me?

How to write shell scripts in Sun Solaris? How to run/execute the script?

Please post in detail.

Best Answer

  • create script file, first row beginning with this: #!/bin/sh -
  • add script body (echo Hello world) on following lines after that.
  • make script executable (chmod u+x scriptfile)
  • either put scriptfile somewhere in your path, or invoke it by its pathname.

./scriptfile is the relative pathname if your current directory is where you put the script.

Related Topic