The UNIX and Linux Forums  


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 -->
  #1 (permalink)  
Old 12-16-2005
rwunwla rwunwla is offline
Registered User
  
 

Join Date: Dec 2005
Location: Jersey City, NJ
Posts: 9
Question Skip item by using substring

I have a file contents like this....

item1
item2
#item3
item4
#item5
item6
....

I have a KSH script to read this file into an array.
I have a for loop which will read each item...
I want to be able to skip those item start with # sign as first character in a if condiction inside the for loop.

How can I use substr, or parse or whatever way in ksh to detect the first character is a # sign.

Thanks in advance.