Anonymous
public text v1 · immutable#!/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