The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 09-13-2006
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Quote:
Originally Posted by blowtorch
If using Solaris, bash may not be installed. Use ksh. Change the #!/bin/sh to #!/bin/ksh. I don't know if what you are trying works with ksh or not though.
The construct ${line:0:2} will not work with ksh. You will have to rewrite that part of the code. Use typeset. Something like

Code:
typeset -L2 string
string=$line
if [[ "$string" == "< " ]] ; then
echo ${line#$string} is removed.
fi;