The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 09-28-2007
er_ashu er_ashu is offline
Registered User
 

Join Date: Apr 2007
Posts: 44
A basic question of FOR loop

Hi,
have a basic query.
Please see the below code:

list="one two three"
for var in $list ; do
echo $var
list="nolist"
Done

Wht if I want to print only first/ last line in the list

Eg one & three

Regards
er_ashu
Reply With Quote
Forum Sponsor