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

  • 07.19.05
    6

    Tuesday Jul 19, 2005

    I used to rely on self-medication, I guess I still do that from time…
  • 07.19.05
    0

    Tuesday Jul 19, 2005

    i will be just fine.
  • 07.15.05
    4

    Friday Jul 15, 2005

    testicles
  • 07.13.05
    2

    Wednesday Jul 13, 2005

    ?? ???????? ??? ????? ???????????? ?? ??
  • 07.10.05
    1

    Monday Jul 11, 2005

    I <3 Katamari Damacy
  • 07.09.05
    1

    Saturday Jul 09, 2005

    yeah man fuckin' a
  • 07.05.05
    6

    Tuesday Jul 05, 2005

    c'mon everyone admit it you love lucky charms
  • 07.04.05
    3

    Monday Jul 04, 2005

    its been a long and heated weekend please let the upcoming week c…
  • 06.29.05
    3

    Wednesday Jun 29, 2005

    and there was no love it was not there listen i can sit here this …
  • 06.26.05
    0

    Monday Jun 27, 2005

    Super low fi version of my 24 hour film "8:247" is available at the f…

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

23
years
11
months
3
days
  • 5,509,826 fans
  • 41,393 fans
  • 10,327,617 followers
  • 4,600 SuicideGirls
  • 1,115,023 followers
  • 14,954,341 photos
  • 321,315 followers
  • 61,478,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