This commit is contained in:
milisbir 2018-02-23 15:43:39 +02:00
parent baae348580
commit 3a41470749
1 changed files with 16 additions and 0 deletions

16
bin/bilgi Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
hata(){
echo "bilgi alınacak komut paremetresi eksik";
exit 1
}
[ $1 ] && _komut=$1 || hata
for sayfa in 1 2 3 4 5 6 7 8 l n;do
yanit=$(curl -s --head https://linux.die.net/man/$sayfa/${_komut} | head -n 1 | cut -d' ' -f2)
if [ $yanit == "200" ];then
curl -s https://linux.die.net/man/$sayfa/${_komut} > /tmp/${_komut}.html;
[ $(type -p lynx) ] && lynx /tmp/${_komut}.html ||echo "file:///tmp/${_komut}.html"
exit 1
fi
done