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
Solved

How to run Bourne shell script on Unix.

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
reinstall 1 85
ftpcommand 2 67
Most secure Linux or x86 Unix that are least prone to ransomware/malware 24 130
retrieve nuemaric value from txt file in shell script 3 73
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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.:

828 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