Este script básico, para manejar una agenda telefónica. Es un ejemplo que puede servir como base para realizar un SCRIPT más completo. Aquí solo guarda el nombre y número telefónico. Pero queda a la imaginación para darle un uso más profesional.
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76  | 
						#!/bin/bash # Verificar si se proporcionó un argumento (nombre del archivo de la agenda) if [ $# -eq 0 ]; then     echo "Uso: $0 archivo_agenda.txt"     exit 1 fi # Función para añadir un nuevo registro a la agenda function añadir_registro() {     echo "Ingrese el nombre:"     read nombre     echo "Ingrese el número de teléfono:"     read telefono     echo "$nombre:$telefono" >> "$1"     echo "Registro añadido con éxito." } # Función para buscar un registro en la agenda function buscar_registro() {     echo "Ingrese el nombre a buscar:"     read nombre_buscar     grep -i "$nombre_buscar" "$1" } # Función para borrar un registro de la agenda function borrar_registro() {     echo "Ingrese el nombre a borrar:"     read nombre_borrar     grep -iv "$nombre_borrar" "$1" > temp.txt     mv temp.txt "$1"     echo "Registro borrado con éxito." } # Función para editar un registro en la agenda function editar_registro() {     echo "Ingrese el nombre del registro a editar:"     read nombre_editar     echo "Ingrese el nuevo nombre:"     read nuevo_nombre     echo "Ingrese el nuevo número de teléfono:"     read nuevo_telefono     grep -iv "$nombre_editar" "$1" > temp.txt     echo "$nuevo_nombre:$nuevo_telefono" >> temp.txt     mv temp.txt "$1"     echo "Registro editado con éxito." } # Menú principal while true; do     echo "---------------------------------------"     echo "       AGENDA TELEFÓNICA"     echo "---------------------------------------"     echo "1. Añadir un registro"     echo "2. Buscar un registro"     echo "3. Borrar un registro"     echo "4. Editar un registro"     echo "5. Salir"     echo "---------------------------------------"     echo -n "Elija una opción: "     read opcion     case $opcion in         1) añadir_registro "$1";;         2) buscar_registro "$1";;         3) borrar_registro "$1";;         4) editar_registro "$1";;         5) echo "Saliendo..."; exit 0;;         *) echo "Opción inválida";;     esac done  |