how to read from a file using shell scripts

Discussion in 'Software' started by pallavimahajan, Aug 8, 2005.

  1. pallavimahajan

    pallavimahajan Private E-2

    Can anyone tell me a method on how to read a config file from a shell script.
    My config file has 5 arameters and i want to read them
    Thanks
     
  2. theefool

    theefool Geekified

    Try using the TYPE command.

    Also, what scripting language is this? What OS, and perhaps post your script for us to peruse.
     
  3. Kodo

    Kodo SNATCHSQUATCH

    in linux it's

    cat <filepath/name>
    or vi <filepath/name> (will actually open the vi text editor)
     
  4. pallavimahajan

    pallavimahajan Private E-2

    for i in `cat config.sh `;
    do
    export $i;
    done

    im doing in linux, and found this helpful
     
  5. theefool

    theefool Geekified

    I need to remember you are using linux, which I haven't dealt with in 2 years.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds