Solved

How to run Bourne shell script on Unix.

Posted on 1997-10-01
2
605 Views
Last Modified: 2010-04-21
I wrote a simple Bourne shell script to test, but I don't know how to run it on Unix system.  Thanks for help. Mitsuru

#!  /bin/sh
#  SHOWINFO: Bourne shell acript to display an information file

#  If the information file exists, display its contents.
#  Otherwise, if the files does not exist, but if an older version exists, display the older version.  
#  If neither file exists, display an error message
     if   [-f  info]
     then
          echo "This information file has been found.";
          more info
     elif   [-f  info.old]
     then
          echo "Only the old information file was found.";
          more info.old
     else
          echo "The information file was not found."
     fi

0
Comment
Question by:mkido
2 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 2007168
 sh script.sh
or
  chmod a+x ./script.sh
  ./script.sh
0
 
LVL 1

Accepted Solution

by:
weinerk earned 50 total points
ID: 2007169
recomendation from ozo will work

sh script.sh

or

chmod a+x ./script.sh
./script.sh
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now