The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 07-04-2009
scottn scottn is offline Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 1,053
The first line of a script specifies what "language" the script is written in (and should be used to execute what follows).

Code:
#!/bin/sh       - means Bourne shell
#!/bin/ksh      - means Korn shell
#!/bin/bash     - means Bourne Again shell
#!/usr/bin/perl - means Perl
Code:
#!/bin/bash
t=100            - sets a variable called t to 100
echo $t          - prints the value of variable t
echo $tea        - prints the value of variable tea
echo ${t}ea      - prints the value of t followed by the literal characters ea
{ and } are used to separate a variable name from other text - otherwise the shell can't distinguish the variable name from the other text.

Last edited by scottn; 07-04-2009 at 12:43 PM..