Advertisement
Guest User

FrankLv

a guest
Sep 4th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. [username@resetpw (0)]$cat inputtest.sh
  2. #!/bin/sh
  3.  
  4. echo "Enter ID : "; read username
  5. echo "Enter New password : "; read password
  6. echo "get user id " $username " and password " $password
  7.  
  8. [username@resetpw (0)]$./inputtest.sh
  9. Enter ID :
  10. hello
  11. Enter New password :
  12. worldpasswd
  13. get user id hello and password worldpasswd
  14. [username@resetpw (0)]$
  15. [username@resetpw (0)]$./inputtest.sh<<EOF
  16. > hello
  17. > worldpasswd
  18. > EOF
  19. Enter ID :
  20. Enter New password :
  21. get user id hello and password worldpasswd
  22. [username@resetpw (0)]$
  23. [username@resetpw (0)]$echo hello>tempfile
  24. [username@resetpw (0)]$echo worldpasswd>>tempfile
  25. [username@resetpw (0)]$./inputtest.sh <tempfile
  26. Enter ID :
  27. Enter New password :
  28. get user id hello and password worldpasswd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement