1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Retrieve File name using shell script

Discussion in 'Oracle Development General' started by ssankars, Feb 7, 2014.

  1. ssankars

    ssankars Premium Member

    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    110
    Location:
    Hyderabad
    HI Gurus,

    I have a requirement like i want to retrieve all the file name present in a folder using shell script.
    I have written like below and registered it as host program but its erroring out.
    Please Gurus help me its very urgent for me.

    for i in `ls -a *.*`
    do
    echo "$i"
    done

    Thanks in Advance,

    Sidharth
     
  2. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    HI,

    Which error you got?
     
  3. ssankars

    ssankars Premium Member

    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    110
    Location:
    Hyderabad
    Syntax error at "do"
     
  4. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    I am not sure but Try this....

    for i in `ls -a *.*`;
    do
    echo "$i"
    done