Results 1 to 2 of 2

Thread: STDOUT?

  1. #1

    STDOUT?

    Ok, so my script needs to run during the boot sequence. I'm assuming now, after failing to get the output, that I have to do something with STDOUT in order to have this displayed to the screen? Care to enlighten a lost soul?

    Code:
    !/bin/bash
    #
    # Profiler - Choose network profile.
    #
    # Description: Allows users to choose which network profile they want to load \
    #        at boot time..
    #
    #
    
    ## Function to actually set the profile
    ######################### Gold Version ##################################################
    #CONFDIR=/etc
    #setprofile ()
    #    {
    #    rm $CONFDIR/sysconfig/network ; ln -s $CONFDIR/files/sysconfig/network.$PROFILE $CONFDIR/sysconfig/network
    #    rm $CONFDIR/sysconfig/network-scripts/ifcfg-eth0 ; ln -s $CONFDIR/files/sysconfig/network-scripts/ifcfg-eth0.$PROFILE $CONFDIR/sysconfig/network-scripts/ifcfg-eth0
    #    rm $CONFDIR/hosts ; ln -s $CONFDIR/files/hosts.$PROFILE $CONFDIR/hosts
    #    rm $CONFDIR/resolv.conf ; ln -s $CONFDIR/files/resolv.conf.$PROFILE $CONFDIR/resolv.conf
    #    echo "$PROFILE profile loaded! Continuing to boot..." ; sleep 1 ;
    #    }
    ######################### End Gold Version ###############################################
    ######################### Test Version (Remove when ready to go gold) ####################
    CONFDIR=/etc
    setprofile ()
       {
       rm $CONFDIR/sysconfig/network ; ln -s $CONFDIR/profiler/network.$PROFILE $CONFDIR/sysconfig/network
       rm $CONFDIR/sysconfig/network-scripts/ifcfg-eth0 ; ln -s $CONFDIR/profiler/ifcfg-eth0.$PROFILE $CONFDIR/sysconfig/network-scripts/ifcfg-eth0
       rm $CONFDIR/hosts ; ln -s $CONFDIR/profiler/hosts.$PROFILE $CONFDIR/hosts
       rm $CONFDIR/resolv.conf ; ln -s $CONFDIR/profiler/resolv.conf.$PROFILE $CONFDIR/resolv.conf
       echo "$PROFILE profile loaded! Continuing to boot..." ; sleep 1 ;
       }
    ######################### End test version ##############################################
    
    if [ ! -f /etc/profiler/profiles ]; then
    #if [ ! -f /home/poo/profiler/profiles ]; then # for testing, remove when ready to go gold.
       echo "Profile list not found. Please check and reinstall Profiler if necessary" ;
       exit 1
    fi
    
    PROFILELIST=/etc/profiler/profiles
    #PROFILELIST=/home/poo/profiler/profiles # for testing, remove when ready to go gold.
    
    # Show shoices to the screen
    echo ; echo
    echo -e "\t\t\tNetwork Profiler"
    echo -e "\t\t\tPlease make your choice"
    echo ; echo
    
    ### Here is where we actually get the choice. There is a bit of sanity check to make sure they enter a correct choice
    while [ ! $PROFILE ] ; do
       select selection in `cat $PROFILELIST`; do
              case $selection in
            * ) PROFILE=$selection ; break ;;
              esac
       done
    done
    
    ### Now we have thier selection, below we do something with it!
    case $PROFILE in
     Create ) echo "not done yet";; #call profile creator here, recycle the script. 
        * ) setprofile ;; #call profile set function here.
    esac
    
    exit 0

  2. #2

    Re: STDOUT?

    hmm .. normally echo should work but maybe you are calling the script before the environment variables get set, so you could try /bin/echo instead of just echo. If that isnt working try writing directly to stdout : echo "asdf" > /dev/tty1 .. for example

Similar Threads

  1. PERL: system and grabbing STDOUT
    By Blaqb0x in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 05-14-2003, 07:14 PM

Bookmarks

Posting Permissions

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