+ Reply to Thread
Results 1 to 2 of 2

Thread: Unix read command (bash)

  1. #1
    kbjradmin's Avatar
    kbjradmin is offline x10 Elder kbjradmin is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    Washington State, USA
    Posts
    512

    Unix read command (bash)

    i'm working on a script that needs to read the variable $1, one character at a time and assign those characters to an array. i tried to use this line:
    Code:
    echo $1 | read -n 1 -a chars
    however, everytime i try to read the variable $chars with echo ${chars[*]}, it turns up empty.

    please help.

  2. #2
    quantum1's Avatar
    quantum1 is offline x10Hosting Member quantum1 is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    near Nashville, TN
    Posts
    68

    Re: Unix read command (bash)

    Can you post the portion of script where you use the above command? Thanks.
    Two rules of development:
    1) Computers work for people; People do not work for computers
    2) Maintainability is all that matters.

+ Reply to Thread

Similar Threads

  1. Can you read this?
    By tittat in forum Off Topic
    Replies: 19
    Last Post: 03-28-2009, 10:29 AM
  2. Please read these rules!!!
    By kkenny in forum Tutorials
    Replies: 0
    Last Post: 04-25-2008, 03:56 AM
  3. Please read these rules!!!
    By kkenny in forum Graphics & Webdesign
    Replies: 0
    Last Post: 04-25-2008, 03:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers