Solved

How to run Bourne shell script on Unix.

Posted on 1997-10-01
2
613 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Skill Development 15 191
retrieve nuemaric value from txt file in shell script 3 81
Linux "time" command output redirection 16 220
Using sort and uniq to pare down large syslog 6 73
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…
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
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 find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

749 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