Advertisement
sergio_educacionit

while_ejemplos.sh

Oct 5th, 2022
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. var=0
  4. userid=1
  5.  
  6. while [ $userid -ne $var ];do
  7.  
  8. read -p "ingrese usuario: " user
  9.  
  10. userid=$(grep ^$user /etc/passwd | cut -d ":" -f 3)
  11.  
  12. done
  13.  
  14.  
  15.  
  16.  
  17. # recorrer ficheros
  18.  
  19. file=/etc/passwd
  20.  
  21. while read -r linea; do
  22.  
  23. echo $linea | grep ^ftp > /dev/null && break
  24.  
  25. done < $file
  26.  
  27. echo $linea
  28.  
  29.  
  30. echo fin del programa
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement