hervasiop12345

priult

Sep 26th, 2011
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.35 KB | None | 0 0
  1. #!/bin/bash
  2. #Description: Muestra el primero y último parámetro pasado sin hacer ningún bucle
  3. #Author:jMa
  4.  
  5. if [ $# -eq 0 ]
  6. then
  7.  
  8.   echo "No has pasado ningún parámetro"
  9.  
  10. elif [ $# -eq 1 ]
  11. then
  12.   echo "Sólo hay un parámetro que es $1"
  13.  
  14. else
  15.   echo "El primer argumento es $1"
  16.   echo -n "El último argumento es "
  17.   eval "echo \${$#}"
  18. fi
Advertisement
Add Comment
Please, Sign In to add comment