Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ yes | ./script
- $ yes n | ./script
- $ printf 'ynynyn' | ./script
- $ printf 'yesnnonmayben' | ./script
- $ printf 'yyy' | ./script
- $ ./script << EOF
- y
- y
- y
- EOF
- $ ./script <<< "y
- y
- y
- "
- $ ./script < inputfile
- $ ./script < echo 'yyyyyyyyyyyyyy'
- bash: echo: No such file or directory
- $ ./script 'yyyyyyyyyyyyyy' < echo
- bash: echo: No such file or directory
- # Assume $remote_server, $my_user_id, $my_password, and $my_command were read in earlier
- # in the script.
- # Open a telnet session to a remote server, and wait for a username prompt.
- spawn telnet $remote_server
- expect "username:"
- # Send the username, and then wait for a password prompt.
- send "$my_user_idr"
- expect "password:"
- # Send the password, and then wait for a shell prompt.
- send "$my_passwordr"
- expect "%"
- # Send the prebuilt command, and then wait for another shell prompt.
- send "$my_commandr"
- expect "%"
- # Capture the results of the command into a variable. This can be displayed, or written to disk.
- set results $expect_out(buffer)
- # Exit the telnet session, and wait for a special end-of-file character.
- send "exitr"
- expect eof
- spawn script.sh
- expect "Are you sure you want to continue connecting (yes/no)?"
- send "yes"
- yes | script
- NAME
- yes - output a string repeatedly until killed
- SYNOPSIS
- yes [STRING]...
- yes OPTION
- DESCRIPTION
- Repeatedly output a line with all specified STRING(s), or 'y'.
- # -Wy force signaturewipe (if exists)
- echo "y" | sudo lvcreate -W y -n $lvName -L "$lvSize"G /dev/"$svg" >> $nfsUtilLog
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement