Login
Forgot Password?

OR

Login with Google Login with Twitter Login with Facebook
  • Join
  • Profiles
  • Groups
  • SuicideGirls
  • Photos
  • Videos
  • Shop
Vital Stats

mongoofy

Bay View, Wiscompton

Member Since 2002

Followers 120 Following 138

  • Everything
  • Photos
  • Video
  • Blogs
  • Groups
  • From Others

Tuesday Oct 12, 2004

Oct 12, 2004
0
  • Facebook
  • Tweet
  • Email
#!/bin/ksh

# Use the Set command to designate a variable as a
# simple, 1 dimentional Array.

set -A line_array

# Designate an incoming File Name

file_name='test.dat'

# I use simple array index variables. Arrays in the
# k-shell start with an index of 0.

i=0

# Read a line of data from the Incoming File into the
# variable file_line. Note that the data file is
# redirected into the loop on the "done" command
# at the end of the loop.
# The array, line_array, is indexed by the value of i.
# The data from the File is saved in the next array
# element and the Index , i, is incremented.

while read file_line
do
line_array=${file_line}
let i=${i}+1
done < ${file_name}

# Now that you have the data in the Array you can
# do whatever processing you want on it by addressing
# any of the array elements. In this sample we are
# assuming that the data is in the form of x:y and
# we want to display each value of x.

# Reset the Index to the first element.

i=0

# In order to loop thru each value of the array,
# we check to make sure that the Array Index
# is less than or equal to the total number of array
# elements.
# For our sample we display everything to the left of
# the ':' character.
# Remember to increment the Index value.

while [ ${i} -le ${#line_array[*]} ]
do
echo ${line_array}|cut -f1 -d:
let i=$i+1
done

More Blogs

  • 08.18.08
    3

    Monday Aug 18, 2008

    When, in the course of development, class distinctions have disappear…
  • 07.08.08
    5

    Tuesday Jul 08, 2008

    Well I'm a bachelor for a month... Anyone want to do something fun…
  • 06.24.08
    7

    Tuesday Jun 24, 2008

    heres what i think... ready? i think people need to man up and tak…
  • 05.21.08
    2

    Wednesday May 21, 2008

    i return...
  • 05.02.08
    5

    Friday May 02, 2008

    nobody here loves me anymore eh?
  • 04.27.08
    1

    Sunday Apr 27, 2008

    Seattle anyone? come play? Anyone? hello?
  • 04.07.08
    6

    Monday Apr 07, 2008

    Well holy balls... SO much has changed since last I updated here... …
  • 02.22.08
    7

    Saturday Feb 23, 2008

    This time I thought I'd listen and the story goes... I am the same w…
  • 02.08.08
    4

    Saturday Feb 09, 2008

    so you really fooled me well I wouldn't know I'm too naive or too b…
  • 01.19.08
    8

    Sunday Jan 20, 2008

    I barely have the motivation They say I suffer from a lack of serato…

We at SuicideGirls have been celebrating alternative pin-up girls for:

23
years
10
months
7
days
  • 5,509,826 fans
  • 41,393 fans
  • 10,327,617 followers
  • 4,598 SuicideGirls
  • 1,116,465 followers
  • 14,938,177 photos
  • 321,315 followers
  • 61,438,131 comments
  • Join
  • Profiles
  • Groups
  • Photos
  • Videos
  • Shop
  • Help
  • About
  • Press
  • LIVE

Legal/Tos | DMCA | Privacy Policy | 18 U.S.C. 2257 Record-Keeping Requirements Compliance Statement | Contact Us | Vendo Payment Support
©SuicideGirls 2001-2025

Press enter to search
Fast Hi-res

Click here to join & see it all...

Crop your photo