Advertisement
sergio_educacionit

read_fichero.sh

Jan 13th, 2024
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. archivo="/etc/passwd"
  2.  
  3. while IFS= read -r linea;do
  4.  
  5. # lee el fichero y solo imprime las lineas que tengan el itnerprete
  6. # bash definido para usuarios.
  7.  
  8. echo "Usuario: $linea" | grep bash
  9.  
  10. done < "$archivo"
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement