DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: shellscript

  1. #1
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    Hi

    I was wondering if it´s possible to scan a directory contents using a shell script and put the contents into an array

    list=
    xxxxx, yyyyy, zzzzz etc

    also is there anyway to filter the file names? Such as if a file is named a.data.txt then

    list=
    data.txt filtering out a.

    Any help would appreciated

    thanx

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    #!/bin/ksh
    for l in `ls | awk -F. '{print $2"."$3}'`; do
    list=$list,$l
    done
    echo $list
    Jeff Hunter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width