Last active
August 29, 2015 14:01
-
-
Save ismailakbudak/6c0455ec43e493cace6a to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
# Yorum satırı | |
# İlk satırdaki komut ise yorum değildir. | |
# Bu satırın anlamı bu scripti bash shell de çalıştır. | |
# Terminali temizle komutu | |
clear | |
# Teminale Hello world yazar | |
echo "Hello world" | |
# Şuanda ki kullanıcıyı terminale yazar | |
echo $USER | |
# Değişkenlerin satır içinde kullanımına bir örnek | |
echo "Hi, $USER!" | |
# Kullanıcıdan değer okuma örneği | |
echo "Value :" | |
read year | |
echo "You entered value: $year" | |
# Girilen değerin integer mı string mi olduğunu öğrenme | |
if [ $year -eq $year 2>/dev/null ] | |
then | |
echo "$year is an integer" | |
else | |
echo "$year is not an integer" | |
fi | |
# $( ls / ) Root dizindeki dosyaları terminale yazar | |
# $( ls /home/ ) şeklinde de istenilen dizindeki dosyalar listelenebilir | |
for i in $( ls / ); do | |
echo item: $i | |
done | |
# Bash script ile for döngüsü kullanıcının girdiği parametreler terminale yazılır | |
COUNT=0 | |
for i in $@ ; do | |
echo $i | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment