Multidimensional arrays in Korn shell

This is a discussion on Multidimensional arrays in Korn shell within the Tech Board forums, part of the Community Boards category; Hello, How do you implement multidimensional arrays in Korn shell. I have to implement popd and pushd in ksh, and ...

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    224

    Multidimensional arrays in Korn shell

    Hello,
    How do you implement multidimensional arrays in Korn shell. I have to implement popd and pushd in ksh, and I'm thinking about implementing them with arrays. I want to have an inode-like structure for the stack (in case you have more than 1024 directories).
    Thanks,
    Yasir

  2. #2
    Registered User
    Join Date
    Sep 2003
    Posts
    224
    Ok, there are no multidimensional arrays. Is there a built in way to count the number of words in a string?

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,761
    Here's one way...
    echo $string | wc -w
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Registered User
    Join Date
    Sep 2003
    Posts
    224
    Thanks, but is there a shell built-in that would do the same? I would perfer not to fork another process to determine the number of words.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multidimensional Arrays
    By jordanguyoflove in forum C Programming
    Replies: 4
    Last Post: 10-16-2008, 07:16 PM
  2. Multidimensional Arrays?
    By CreatedByShadow in forum C++ Programming
    Replies: 7
    Last Post: 01-13-2006, 10:35 PM
  3. Pointers to Multidimensional Arrays
    By kidburla in forum C Programming
    Replies: 10
    Last Post: 10-29-2005, 11:45 PM
  4. Implementing ! functionality for Korn shell
    By Yasir_Malik in forum Linux Programming
    Replies: 1
    Last Post: 06-14-2004, 09:24 PM
  5. Implementing ! functionality for Korn shell
    By Yasir_Malik in forum Tech Board
    Replies: 1
    Last Post: 06-13-2004, 06:27 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21