All pastes #246187 Raw Edit

Anonymous

public text v1 · immutable
#246187 ·published 2006-11-11 23:24 UTC
rendered paste body
#!/bin/bash

if [[ $# -eq 1 ]]
then
    if [[ $1 = "--help" || $1 = "-h" ]]
    then
	echo "ez a help lesz eccer"
	exit 0
    else
      if [[ ! -e "$1" ]]
       then
         echo "Nem lĂ©tező fájl!" >&2      
	 exit 1
       else
        if [[ -d "$1" ]]
	then
	  echo "Konyvtarat adott meg parameterkent!" >&2
	  exit 1
	else
	  sor[1]=`cat $1 | head -n 1`
	  sor[2]=`cat $1 | head -n 2 | tail -n 1`
        fi       
       fi          		
    fi
else
   if [[ $# -eq 0 ]]
   then
     read sor[1]
     read sor[2]
   else
     echo "Hibas paramterezes!" >&2
     exit 1
   fi      	     
fi