Last active
July 18, 2022 11:11
-
-
Save eqhmcow/1403041 to your computer and use it in GitHub Desktop.
SYNTAX ERROR: UNEXPECTED END OF FILE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp /bin/bash ./bash.caps; echo "this will take a while, be patient..."; strings -n 10 bash.caps | egrep -e '^.* .* .* .*$' | grep -Pv '^(_|\s)|\$|\[|;|@|\s\s' | while read i; do perl -pi -e "$/=\"\\0\";next if/ function\S|binding|^(case|select|for|trap|builtin)|_.*_/;next unless m@\\Q$i\\E@;sub b{return\$_ if/%/;uc}\$_=join' ',map{b()}split/ /" bash.caps; done; chmod a+x bash.caps; ./bash.caps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#!/bin/bash
top=0
deger=1
count=0
ort=0
max=0
min=0
echo "1.sayıyı giriniz"
read deger
echo "2.sayıyı giriniz"
read deger2
if [ "$deger" -gt "$deger2" ] then
for mun in
seq $deger $deger2
do
ret=$(factor $mun | grep $mun | cut -d ":" -f 2 | cut -d " " -f 2) #
factor
komutu ile girilen sayıların arasndaki asalları buluyoruz ve onları grep komutu ile çıktılarını kontrol ediliyor.if [ "$ret" -eq "$mun" ]
then
if [ count==0 ]
then
(( max=$ret ))
fi
echo "$mun sayısı ASAL sayıdır.."
((count++))
top=$(( $top + $mun )) #top değişkenine sıfır atayıp 0 her defasında çıkan asalı yani $mun değişkenini if ile döndüre döndüre bir önceki aldığı değer ile toplatıp bütün asalların toplamı bulunyor
ort=$(echo "$top/$count" | bc -l)
elif [ "$deger2" -gt "$deger" ]
then
for mun in
seq $deger2 $deger
do
if [ "$ret" -eq "$mun" ]
then
if [ count==0 ]
then
(( max=$ret ))
fi
echo "$mun sayısı ASAL sayıdır.."
((count++))
top=$(( $top + $mun )) #top değişkenine sıfır atayıp 0 her defasında çıkan asalı yani $mun değişkenini if ile döndüre döndüre bir önceki aldığı değer ile toplatıp bütün asalların toplamı bulunyor
ort=$(echo "$top/$count" | bc -l)
fi
done
fi
echo -e "\n//// İŞLEMİN SONUÇLARI ////"
echo -e "\nAsalların Toplamı: $top"
echo -e "\nGirdiğiniz sayıların arasında $count adet ASAL vardır....."
echo -e "\nSayıların ortalaması: $ort"
echo -e "\nEn BÜyük asal sayı$max"