Find the answer to your Linux question:
Results 1 to 3 of 3
Hi Forum, I am pretty new to unix script and this is my first post!. I have a requirement to execute a series of cli commands and to show the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2011
    Posts
    2

    how to execute clia commands at CLI prompt through script?


    Hi Forum,

    I am pretty new to unix script and this is my first post!. I have a requirement to execute a series of cli commands and to show the outputs. The problem is with the below script I could able to log in to cli prompt and bring CLI prompt but after that cli commands have just get printed at the cli prompt for e.g. board 2, it never gets executed and terminates the script.

    Any help is highly appreciated.
    FYI : I am unable to post the script as getting You are only allowed to post URLs to other sites after you have made 15 posts or more. error.
    I need help for throwing some commands at a prompt like ftp prompt through script.
    Last edited by lifeline2; 02-18-2011 at 04:34 AM. Reason: No icon

  2. #2
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Quote Originally Posted by lifeline2 View Post
    I am unable to post the script as getting You are only allowed to post URLs to other sites after you have made 15 posts or more. error
    Hello and welcome to the forums!

    You can check this thread for a temporary workaround for the 15-post error message:

    http://www.linuxforums.org/forum/fee...ng-forums.html
    oz

  3. #3
    Just Joined!
    Join Date
    Feb 2011
    Posts
    2
    Thanks OZ for a so quick reply
    My script is having "at the rate symbol" so replacing it with A only.

    Code:
    #!/bin/sh
    clear
    login1()
    {
    echo "connecting to $1 Shelf Manager..."
    echo clia | ssh rootA$1
    **echo board 2**
    sleep 2
    }
    echo clia | ssh rootA$1
    echo board 2
    declare -a SHMs=`ping 192.168.0.0 -b -c 2 | grep '(DUP!)' | awk '{print $4}' | sed s/":"/""/g` >> /dev/null
    login1 ${SHMs[0]}
    And my output is :
    Pseudo-terminal will not be allocated because stdin is not a terminal. ssh: : Name or service not known board 2 WARNING: pinging broadcast address connecting to 192.168.0.2 Shelf Manager... Pseudo-terminal will not be allocated because stdin is not a terminal. /usr/X11R6/bin/xauth: not found stty: standard input Pigeon Point Shelf Manager Command Line Interpreter CLI> : Invalid argument board 2

Posting Permissions

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