Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Posts
    2

    Unanswered: How to simulate a ENTER key press through Kshell script

    Hi All,

    I want to simulate a pressing ENTER key through the shell script (Kshell). Could you please share your valuable thoughts on this?


    Thanks

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Talking echo

    On way is to "echo" and pipe a null to your statement in the script:
    Code:
    #!/bin/ksh
    echo "Enter something:"
    echo ''| read x
    echo "Script done: '$x' enter."
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    or just
    Code:
    echo "" | your_script

  4. #4
    Join Date
    Jan 2009
    Posts
    2

    Simulation of pressing ENTER key through shell script

    Hi,

    Thanks for your reply. I have checked this, but it didn't worked in the way it is required.

    Actually, when I execute my script, it navigates to a screen where the screen expects the user to press the ENTER key.

    After incorporating your suggestion to my script, the script navigated me to that screen but it didn't pressed ENTER key to proceed.

    Thanks

Posting Permissions

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