SHARE
TWEET

Untitled

a guest Jan 14th, 2020 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. filename=
  4. interface=
  5.  
  6. function usage() {
  7.     echo $0 -i interface -f filename
  8.     exit 1
  9. }
  10.  
  11. function extract_params() {
  12.  
  13.   if [ $# -ne 4 ]
  14.   then
  15.       usage
  16.   fi
  17.  
  18.   while [ $# -gt 1 ]
  19.   do
  20.       case $1 in
  21.         -f)
  22.             filename=$2
  23.             ;;
  24.         -i)
  25.             interface=$2
  26.             ;;
  27.         *)
  28.             usage
  29.             ;;
  30.     esac
  31.     shift
  32.     shift
  33. done
  34.  
  35. }
  36.  
  37. extract_params $@
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top