Amod Pandey - My Workshop

There is a lot that human can do, for everything else there is [shell] script :)

Sunday, November 18, 2012

shell script: array

# space separated
alphabets=("a" "b" "c" "d")

#To access any element by index
${alphabets[1]}

# to loop
for f in "${alphabets[@]}"

Posted by Amod at 5:00 PM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: linux, shell script array

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2017 (1)
    • ►  January (1)
  • ►  2016 (5)
    • ►  December (3)
    • ►  August (1)
    • ►  March (1)
  • ►  2015 (3)
    • ►  February (1)
    • ►  January (2)
  • ►  2014 (9)
    • ►  July (1)
    • ►  June (3)
    • ►  May (3)
    • ►  April (1)
    • ►  March (1)
  • ►  2013 (13)
    • ►  December (3)
    • ►  September (2)
    • ►  August (2)
    • ►  June (1)
    • ►  April (1)
    • ►  January (4)
  • ▼  2012 (19)
    • ▼  November (3)
      • shell script: array
      • python: tips and tricks
      • shell script: file information
    • ►  October (9)
    • ►  July (1)
    • ►  June (2)
    • ►  May (2)
    • ►  March (1)
    • ►  January (1)
Simple theme. Powered by Blogger.