Solved

How to run Bourne shell script on Unix.

Posted on 1997-10-01
2
609 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
remove a combination of patterns from a file 15 65
How to clone solaris 10 machine 33 129
unix in java example 9 62
How to check the PVU´s on AIX TSM servers? 3 90
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…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

808 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