{"id":38588,"date":"2026-02-03T15:30:40","date_gmt":"2026-02-03T12:30:40","guid":{"rendered":"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/"},"modified":"2026-02-03T15:30:40","modified_gmt":"2026-02-03T12:30:40","slug":"linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler","status":"publish","type":"post","link":"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/","title":{"rendered":"Linux Temelleri &#8211; B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler)"},"content":{"rendered":"<h2>Linux Temelleri &#8211; B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler)<\/h2>\n<p>Linux sistemlerinde otomasyon ve verimlilik, Bash betiklerinin g\u00fcc\u00fcyle \u00f6nemli \u00f6l\u00e7\u00fcde art\u0131r\u0131labilir. Bu serinin yedinci b\u00f6l\u00fcm\u00fcnde, betiklerinizin yaln\u0131zca bir dizi komutu s\u0131rayla y\u00fcr\u00fctmekle kalmay\u0131p, belirli ko\u015fullara g\u00f6re farkl\u0131 kararlar almas\u0131n\u0131 sa\u011flayan temel yap\u0131 ta\u015flar\u0131ndan biri olan ko\u015fullu ifadelere odaklanaca\u011f\u0131z. <code>if<\/code>, <code>elif<\/code> ve <code>else<\/code> gibi yap\u0131lar, betiklerinize zeka katman\u0131z\u0131 ve dinamik senaryolara uyum sa\u011flamas\u0131n\u0131 m\u00fcmk\u00fcn k\u0131lar. Bu makalede, Bash betiklerinde ko\u015fullu ifadelerin nas\u0131l kullan\u0131laca\u011f\u0131n\u0131, farkl\u0131 operat\u00f6rleri ve en iyi uygulamalar\u0131 detayl\u0131 bir \u015fekilde inceleyece\u011fiz.<\/p>\n<h3>Ko\u015fullu \u0130fadelerin Temelleri ve Neden \u00d6nemlidir?<\/h3>\n<p>Bash betiklerinde ko\u015fullu ifadeler, programlama mant\u0131\u011f\u0131n\u0131n temelini olu\u015fturur. Beti\u011finizin belirli bir durumun do\u011fru olup olmad\u0131\u011f\u0131n\u0131 kontrol etmesine ve bu duruma g\u00f6re farkl\u0131 eylemler ger\u00e7ekle\u015ftirmesine olanak tan\u0131r. Bu, betiklerinizin daha esnek, g\u00fc\u00e7l\u00fc ve ak\u0131ll\u0131 olmas\u0131n\u0131 sa\u011flar.<\/p>\n<h4>Karar Verme Mant\u0131\u011f\u0131<\/h4>\n<p>Ko\u015fullu ifadeler, betiklerinize &#8220;e\u011fer bu do\u011fruysa, \u015funu yap; de\u011filse, ba\u015fka bir \u015fey yap&#8221; \u015feklinde karar verme yetene\u011fi kazand\u0131r\u0131r. Bu basit mant\u0131k, karma\u015f\u0131k g\u00f6revleri otomatikle\u015ftirmek i\u00e7in vazge\u00e7ilmezdir. \u00d6rne\u011fin, bir dosyan\u0131n varl\u0131\u011f\u0131n\u0131 kontrol edebilir, bir de\u011fi\u015fkenin de\u011ferini kar\u015f\u0131la\u015ft\u0131rabilir veya bir komutun ba\u015far\u0131yla tamamlan\u0131p tamamlanmad\u0131\u011f\u0131n\u0131 denetleyebilirsiniz.<\/p>\n<h4>Ak\u0131\u015f Kontrol\u00fc<\/h4>\n<p>Ko\u015fullu ifadeler, beti\u011finizin y\u00fcr\u00fctme ak\u0131\u015f\u0131n\u0131 kontrol etmenizi sa\u011flar. Normalde betikler yukar\u0131dan a\u015fa\u011f\u0131ya do\u011fru s\u0131rayla \u00e7al\u0131\u015f\u0131r. Ancak ko\u015fullu ifadelerle, belirli kod bloklar\u0131n\u0131n yaln\u0131zca belirli ko\u015fullar kar\u015f\u0131land\u0131\u011f\u0131nda \u00e7al\u0131\u015fmas\u0131n\u0131 sa\u011flayabilir, b\u00f6ylece beti\u011finizin daha verimli ve amaca y\u00f6nelik hareket etmesini sa\u011flayabilirsiniz.<\/p>\n<h4>Yayg\u0131n Kullan\u0131m Alanlar\u0131<\/h4>\n<p>Ko\u015fullu ifadeler, g\u00fcnl\u00fck Linux g\u00f6revlerinde ve betikleme senaryolar\u0131nda geni\u015f bir kullan\u0131m alan\u0131na sahiptir:<\/p>\n<ul>\n<li>Dosya ve dizin varl\u0131\u011f\u0131n\u0131 kontrol etme.<\/li>\n<li>Kullan\u0131c\u0131 girdilerini do\u011frulama.<\/li>\n<li>Sistem kaynaklar\u0131n\u0131 (disk alan\u0131, bellek) denetleme.<\/li>\n<li>Bir komutun ba\u015far\u0131 kodunu (exit status) kontrol etme.<\/li>\n<li>De\u011fi\u015fken de\u011ferlerini kar\u015f\u0131la\u015ft\u0131rma.<\/li>\n<li>Uygulama veya servis durumunu izleme.<\/li>\n<\/ul>\n<h3>Basit <code>if<\/code> \u0130fadesi<\/h3>\n<p>Bash&#8217;teki en temel ko\u015fullu yap\u0131 <code>if<\/code> ifadesidir. Belirli bir ko\u015ful do\u011fruysa bir komut blo\u011funu y\u00fcr\u00fctmek i\u00e7in kullan\u0131l\u0131r.<\/p>\n<h4>S\u00f6z Dizimi (Syntax)<\/h4>\n<p>Basit bir <code>if<\/code> ifadesinin genel s\u00f6z dizimi \u015f\u00f6yledir:<\/p>\n<pre><code class=\"language-bash\">\nif [ ko\u015ful ]; then\n    # Ko\u015ful do\u011fruysa \u00e7al\u0131\u015facak komutlar\nfi\n<\/pre>\n<p><\/code><br \/>\nBurada <code>ko\u015ful<\/code>, genellikle bir test ifadesi veya komutun ba\u015far\u0131 kodunu kontrol eden bir yap\u0131d\u0131r. <code>then<\/code> anahtar kelimesi, ko\u015ful do\u011fru oldu\u011funda y\u00fcr\u00fct\u00fclecek komut blo\u011funu ba\u015flat\u0131r. <code>fi<\/code> ise <code>if<\/code> blo\u011funu sonland\u0131r\u0131r. K\u00f6\u015feli parantezler (<code>[ ]<\/code>) i\u00e7inde kullan\u0131lan ifade bir komuttur ve <code>test<\/code> komutunun bir k\u0131sayoludur. K\u00f6\u015feli parantezlerin her iki taraf\u0131nda da bo\u015fluk b\u0131rakmak zorunludur.<\/p>\n<h4>\u00d6rnek Kullan\u0131m: Dosya Var M\u0131?<\/h4>\n<p>Bir dosyan\u0131n sistemde var olup olmad\u0131\u011f\u0131n\u0131 kontrol eden basit bir betik yazal\u0131m:<\/p>\n<pre><code class=\"language-bash\">\n#!\/bin\/bash\n\nDOSYA=\"benim_dosyam.txt\"\n\nif [ -f \"$DOSYA\" ]; then\n    echo \"$DOSYA mevcut.\"\nfi\n<\/pre>\n<p><\/code><br \/>\nBu \u00f6rnekte, <code>-f<\/code> operat\u00f6r\u00fc <code>$DOSYA<\/code> de\u011fi\u015fkeninin bir normal dosya olup olmad\u0131\u011f\u0131n\u0131 kontrol eder. E\u011fer dosya mevcutsa, ekrana bir mesaj yazd\u0131r\u0131l\u0131r.<\/p>\n<h4>Test Operat\u00f6rleri: Say\u0131sal Kar\u015f\u0131la\u015ft\u0131rmalar<\/h4>\n<p>Bash, say\u0131sal de\u011ferleri kar\u015f\u0131la\u015ft\u0131rmak i\u00e7in \u00f6zel operat\u00f6rler sunar:<\/p>\n<table border=\"1\">\n<thead>\n<tr>\n<th>Operat\u00f6r<\/th>\n<th>A\u00e7\u0131klama<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>-eq<\/code><\/td>\n<td>E\u015fittir (equal to)<\/td>\n<\/tr>\n<tr>\n<td><code>-ne<\/code><\/td>\n<td>E\u015fit de\u011fildir (not equal to)<\/td>\n<\/tr>\n<tr>\n<td><code>-gt<\/code><\/td>\n<td>B\u00fcy\u00fckt\u00fcr (greater than)<\/td>\n<\/tr>\n<tr>\n<td><code>-ge<\/code><\/td>\n<td>B\u00fcy\u00fck veya e\u015fittir (greater than or equal to)<\/td>\n<\/tr>\n<tr>\n<td><code>-lt<\/code><\/td>\n<td>K\u00fc\u00e7\u00fckt\u00fcr (less than)<\/td>\n<\/tr>\n<tr>\n<td><code>-le<\/code><\/td>\n<td>K\u00fc\u00e7\u00fck veya e\u015fittir (less than or equal to)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-bash\">\n#!\/bin\/bash\n\nSAYI1=10\nSAYI2=5\n\nif [ \"$SAYI1\" -gt \"$SAYI2\" ]; then\n    echo \"$SAYI1, $SAYI2'den b\u00fcy\u00fckt\u00fcr.\"\nfi\n<\/pre>\n<p><\/code><\/p>\n<h4>Test Operat\u00f6rleri: Dize Kar\u015f\u0131la\u015ft\u0131rmalar\u0131<\/h4>\n<p>Dize (string) de\u011ferlerini kar\u015f\u0131la\u015ft\u0131rmak i\u00e7in kullan\u0131lan operat\u00f6rler:<\/p>\n<table border=\"1\">\n<thead>\n<tr>\n<th>Operat\u00f6r<\/th>\n<th>A\u00e7\u0131klama<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>=<\/code><\/td>\n<td>E\u015fittir (iki dize ayn\u0131ysa do\u011fru)<\/td>\n<\/tr>\n<tr>\n<td><code>!=<\/code><\/td>\n<td>E\u015fit de\u011fildir (iki dize farkl\u0131ysa do\u011fru)<\/td>\n<\/tr>\n<tr>\n<td><code>-z<\/code><\/td>\n<td>Dize bo\u015fsa do\u011fru (zero length)<\/td>\n<\/tr>\n<tr>\n<td><code>-n<\/code><\/td>\n<td>Dize bo\u015f de\u011filse do\u011fru (non-zero length)<\/td>\n<\/tr>\n<tr>\n<td><code><<\/code><\/td>\n<td>Alfabetik olarak k\u00fc\u00e7\u00fckt\u00fcr (ASCII de\u011ferine g\u00f6re)<\/td>\n<\/tr>\n<tr>\n<td><code>><\/code><\/td>\n<td>Alfabetik olarak b\u00fcy\u00fckt\u00fcr (ASCII de\u011ferine g\u00f6re)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Not:<\/strong> <code><<\/code> ve <code>><\/code> operat\u00f6rleri <code>[[ ]]<\/code> veya <code>(( ))<\/code> i\u00e7inde kullan\u0131lmal\u0131d\u0131r, veya <code>\\<\/code> ile escape edilmelidir (<code>\\<<\/code>, <code>\\><\/code>). Aksi takdirde dosya y\u00f6nlendirme olarak alg\u0131lanabilirler.<\/p>\n<pre><code class=\"language-bash\">\n#!\/bin\/bash\n\nKULLANICI_ADI=\"admin\"\nGIRILEN_KULLANICI=\"admin\"\n\nif [ \"$KULLANICI_ADI\" = \"$GIRILEN_KULLANICI\" ]; then\n    echo \"Kullan\u0131c\u0131 ad\u0131 do\u011fru.\"\nfi\n\nif [ -z \"$BOS_DEGISKEN\" ]; then\n    echo \"BOS_DEGISKEN bo\u015ftur.\"\nfi\n<\/pre>\n<p><\/code><\/p>\n<h3><code>if-else<\/code> \u0130fadesi<\/h3>\n<p>Bazen bir ko\u015fulun do\u011fru olup olmad\u0131\u011f\u0131na ba\u011fl\u0131 olarak iki farkl\u0131 eylem ger\u00e7ekle\u015ftirmek isteyebiliriz. \u0130\u015fte bu noktada <code>if-else<\/code> ifadesi devreye girer.<\/p>\n<h4>S\u00f6z Dizimi ve Mant\u0131\u011f\u0131<\/h4>\n<p><code>if-else<\/code> yap\u0131s\u0131, ko\u015ful do\u011fruysa bir komut blo\u011funu, yanl\u0131\u015fsa ba\u015fka bir komut blo\u011funu y\u00fcr\u00fct\u00fcr.<\/p>\n<pre><code class=\"language-bash\">\nif [ ko\u015ful ]; then\n    # Ko\u015ful do\u011fruysa \u00e7al\u0131\u015facak komutlar\nelse\n    # Ko\u015ful yanl\u0131\u015fsa \u00e7al\u0131\u015facak komutlar\nfi\n<\/pre>\n<p><\/code><\/p>\n<h4>\u00d6rnek Kullan\u0131m: Kullan\u0131c\u0131 Giri\u015fi Kontrol\u00fc<\/h4>\n<p>Bir beti\u011fin, kullan\u0131c\u0131n\u0131n belirli bir girdiyi sa\u011flay\u0131p sa\u011flamad\u0131\u011f\u0131n\u0131 kontrol etmesi yayg\u0131n bir senaryodur.<\/p>\n<pre><code class=\"language-bash\">\n#!\/bin\/bash\n\nread -p \"L\u00fctfen ad\u0131n\u0131z\u0131 girin: \" AD\n\nif [ -n \"$AD\" ]; then\n    echo \"Merhaba, $AD!\"\nelse\n    echo \"Ad\u0131n\u0131z\u0131 girmediniz. L\u00fctfen tekrar deneyin.\"\nfi\n<\/pre>\n<p><\/code><br \/>\nBu betik, kullan\u0131c\u0131n\u0131n bir ad girip girmedi\u011fini kontrol eder. E\u011fer <code>AD<\/code> de\u011fi\u015fkeni bo\u015f de\u011filse (<code>-n<\/code>), kullan\u0131c\u0131ya \u00f6zel bir kar\u015f\u0131lama mesaj\u0131 g\u00f6sterir; aksi takdirde bir uyar\u0131 mesaj\u0131 verir.<\/p>\n<h4><code>else<\/code> Blo\u011funun \u00d6nemi<\/h4>\n<p><code>else<\/code> blo\u011fu, beti\u011finizin her zaman bir yedek plan\u0131 olmas\u0131n\u0131 sa\u011flar. Bu, beklenmedik durumlar\u0131 veya ko\u015fulun kar\u015f\u0131lanmad\u0131\u011f\u0131 senaryolar\u0131 ele almak i\u00e7in kritik \u00f6neme sahiptir. Beti\u011finizin daha sa\u011flam ve kullan\u0131c\u0131 dostu olmas\u0131n\u0131 sa\u011flar.<\/p>\n<h3><code>if-elif-else<\/code> \u0130fadesi<\/h3>\n<p>Birden fazla ko\u015fulu kontrol etmeniz gerekti\u011finde <code>if-elif-else<\/code> yap\u0131s\u0131 \u00e7ok kullan\u0131\u015fl\u0131d\u0131r. <code>elif<\/code> (else if'in k\u0131saltmas\u0131), ek ko\u015fullar tan\u0131mlaman\u0131za olanak tan\u0131r.<\/p>\n<h4>\u00c7oklu Ko\u015fullar\u0131 Y\u00f6netme<\/h4>\n<p>Bu yap\u0131, bir dizi ko\u015fulu s\u0131rayla kontrol etmenizi sa\u011flar. \u0130lk do\u011fru ko\u015ful bulundu\u011funda, ilgili kod blo\u011fu y\u00fcr\u00fct\u00fcl\u00fcr ve di\u011fer <code>elif<\/code> veya <code>else<\/code> bloklar\u0131 atlan\u0131r.<\/p>\n<h4>S\u00f6z Dizimi<\/h4>\n<pre><code class=\"language-bash\">\nif [ ko\u015ful1 ]; then\n    # Ko\u015ful1 do\u011fruysa \u00e7al\u0131\u015facak komutlar\nelif [ ko\u015ful2 ]; then\n    # Ko\u015ful1 yanl\u0131\u015f ama Ko\u015ful2 do\u011fruysa \u00e7al\u0131\u015facak komutlar\nelif [ ko\u015ful3 ]; then\n    # Ko\u015ful1 ve Ko\u015ful2 yanl\u0131\u015f ama Ko\u015ful3 do\u011fruysa \u00e7al\u0131\u015facak komutlar\nelse\n    # Hi\u00e7bir ko\u015ful do\u011fru de\u011filse \u00e7al\u0131\u015facak komutlar\nfi\n<\/pre>\n<p><\/code><\/p>\n<h4>\u00d6rnek Kullan\u0131m: Notland\u0131rma Sistemi<\/h4>\n<p>Bir \u00f6\u011frencinin ald\u0131\u011f\u0131 puana g\u00f6re notunu belirleyen bir betik yazal\u0131m:<\/p>\n<pre><code class=\"language-bash\">\n#!\/bin\/bash\n\nread -p \"L\u00fctfen notunuzu girin (0-100): \" NOT\n\nif [ \"$NOT\" -ge 90 ]; then\n    echo \"Notunuz: A\"\nelif [ \"$NOT\" -ge 80 ]; then\n    echo \"Notunuz: B\"\nelif [ \"$NOT\" -ge 70 ]; then\n    echo \"Notunuz: C\"\nelif [ \"$NOT\" -ge 60 ]; then\n    echo \"Notunuz: D\"\nelse\n    echo \"Notunuz: F\"\nfi\n<\/pre>\n<p><\/code><br \/>\nBu \u00f6rnekte, betik \u00f6nce notun 90 veya \u00fczeri olup olmad\u0131\u011f\u0131n\u0131 kontrol eder. De\u011filse, 80 veya \u00fczeri olup olmad\u0131\u011f\u0131n\u0131 kontrol eder ve bu \u015fekilde devam eder. Hi\u00e7bir ko\u015ful kar\u015f\u0131lanmazsa, <code>else<\/code> blo\u011fu \u00e7al\u0131\u015f\u0131r.<\/p>\n<h4>S\u0131ralaman\u0131n \u00d6nemi<\/h4>\n<p><code>if-elif-else<\/code> yap\u0131s\u0131nda ko\u015fullar\u0131n s\u0131ras\u0131 \u00e7ok \u00f6nemlidir. Betik, ko\u015fullar\u0131 yukar\u0131dan a\u015fa\u011f\u0131ya do\u011fru kontrol eder ve ilk do\u011fru ko\u015fulun blo\u011funu y\u00fcr\u00fct\u00fcr. E\u011fer yukar\u0131daki \u00f6rnekte <code>if [ \"$NOT\" -ge 60 ]<\/code> ko\u015fulunu en \u00fcste koysayd\u0131k, 90 alan bir \u00f6\u011frenci bile \"D\" notu al\u0131rd\u0131 \u00e7\u00fcnk\u00fc 90 da 60'tan b\u00fcy\u00fckt\u00fcr ve ilk ko\u015ful do\u011fru olurdu. Bu y\u00fczden en spesifik veya en k\u0131s\u0131tlay\u0131c\u0131 ko\u015fullar\u0131 \u00f6nce kontrol etmek genellikle en iyi yakla\u015f\u0131md\u0131r.<\/p>\n<h3>Mant\u0131ksal Operat\u00f6rler (<code>&&<\/code>, <code>||<\/code>, <code>!<\/code>)<\/h3>\n<p>Bazen birden fazla ko\u015fulu tek bir ifadede birle\u015ftirmeniz gerekebilir. Bash, bu ama\u00e7la mant\u0131ksal operat\u00f6rler sunar.<\/p>\n<h4><code>AND<\/code> Operat\u00f6r\u00fc (<code>&&<\/code>)<\/h4>\n<p><code>&&<\/code> operat\u00f6r\u00fc, iki ko\u015fulun da do\u011fru olmas\u0131 durumunda genel ifadenin do\u011fru olmas\u0131n\u0131 sa\u011flar.<\/p>\n<pre><code class=\"language-bash\">\nif [ ko\u015ful1 ] && [ ko\u015ful2 ]; then\n    # Her iki ko\u015ful da do\u011fruysa \u00e7al\u0131\u015f\u0131r\nfi\n<\/pre>\n<p><\/code><br \/>\nVeya <code>[[ ]]<\/code> ile:<\/p>\n<pre><code class=\"language-bash\">\nif [[ ko\u015ful1 && ko\u015ful2 ]]; then\n    # Her iki ko\u015ful da do\u011fruysa \u00e7al\u0131\u015f\u0131r\nfi\n<\/pre>\n<p><\/code><\/p>\n<h4><code>OR<\/code> Operat\u00f6r\u00fc (<code>||<\/code>)<\/h4>\n<p><code>||<\/code> operat\u00f6r\u00fc, iki ko\u015fuldan en az birinin do\u011fru olmas\u0131 durumunda genel ifadenin do\u011fru olmas\u0131n\u0131 sa\u011flar.<\/p>\n<pre><code class=\"language-bash\">\nif [ ko\u015ful1 ] || [ ko\u015ful2 ]; then\n    # Ko\u015fullardan en az biri do\u011fruysa \u00e7al\u0131\u015f\u0131r\nfi\n<\/pre>\n<p><\/code><br \/>\nVeya <code>[[ ]]<\/code> ile:<\/p>\n<pre><code class=\"language-bash\">\nif [[ ko\u015ful1 || ko\u015ful2 ]]; then\n    # Ko\u015fullardan en az biri do\u011fruysa \u00e7al\u0131\u015f\u0131r\nfi\n<\/pre>\n<p><\/code><\/p>\n<h4><code>NOT<\/code> Operat\u00f6r\u00fc (<code>!<\/code>)<\/h4>\n<p><code>!<\/code> operat\u00f6r\u00fc, bir ko\u015fulun sonucunu tersine \u00e7evirir. Do\u011fruyu yanl\u0131\u015fa, yanl\u0131\u015f\u0131 do\u011fruya \u00e7evirir.<\/p>\n<pre><code class=\"language-bash\">\nif ! [ ko\u015ful ]; then\n    # Ko\u015ful yanl\u0131\u015fsa \u00e7al\u0131\u015f\u0131r\nfi\n<\/pre>\n<p><\/code><br \/>\nVeya <code>[[ ]]<\/code> ile:<\/p>\n<pre><code class=\"language-bash\">\nif [[ ! ko\u015ful ]]; then\n    # Ko\u015ful yanl\u0131\u015fsa \u00e7al\u0131\u015f\u0131r\nfi\n<\/pre>\n<p><\/code><\/p>\n<h4>\u00d6rnek Kullan\u0131m: Karma\u015f\u0131k Ko\u015fullar<\/h4>\n<p>Bir kullan\u0131c\u0131n\u0131n ad\u0131n\u0131 ve ya\u015f\u0131n\u0131 kontrol eden bir betik:<\/p>\n<pre><code class=\"language-bash\">\n#!\/bin\/bash\n\nread -p \"Ad\u0131n\u0131z: \" AD\nread -p \"Ya\u015f\u0131n\u0131z: \" YAS\n\nif [[ -n \"$AD\" && \"$YAS\" -ge 18 ]]; then\n    echo \"Merhaba $AD, re\u015fitsiniz.\"\nelif [[ -n \"$AD\" && \"$YAS\" -lt 18 ]]; then\n    echo \"Merhaba $AD, hen\u00fcz re\u015fit de\u011filsiniz.\"\nelse\n    echo \"Ge\u00e7erli bir ad ve ya\u015f girmediniz.\"\nfi\n<\/pre>\n<p><\/code><br \/>\nBu \u00f6rnekte, <code>[[ ]]<\/code> yap\u0131s\u0131 i\u00e7inde mant\u0131ksal <code>&&<\/code> operat\u00f6r\u00fcn\u00fc kullanarak iki ko\u015fulu birle\u015ftiriyoruz. <code>[[ ]]<\/code> kullan\u0131m\u0131, dize kar\u015f\u0131la\u015ft\u0131rmalar\u0131 ve mant\u0131ksal operat\u00f6rler i\u00e7in daha esnek ve okunabilir bir yol sunar.<\/p>\n<h3><code>test<\/code> Komutu ve <code>[<\/code> <code>]<\/code> Kullan\u0131m\u0131<\/h3>\n<p>Bash'te ko\u015fullar\u0131 de\u011ferlendirmek i\u00e7in kullan\u0131lan temel komut <code>test<\/code> komutudur. K\u00f6\u015feli parantezler (<code>[ ]<\/code>), <code>test<\/code> komutunun bir k\u0131sayoludur.<\/p>\n<h4><code>test<\/code> Komutunun Rol\u00fc<\/h4>\n<p><code>test<\/code> komutu, bir veya daha fazla arg\u00fcman alarak belirli bir ko\u015fulu de\u011ferlendirir ve sonucuna g\u00f6re bir \u00e7\u0131k\u0131\u015f kodu (exit status) d\u00f6nd\u00fcr\u00fcr. Ko\u015ful do\u011fruysa <code>0<\/code> (ba\u015far\u0131), yanl\u0131\u015fsa <code>1<\/code> (ba\u015far\u0131s\u0131zl\u0131k) d\u00f6nd\u00fcr\u00fcr. <code>if<\/code> ifadesi, bu \u00e7\u0131k\u0131\u015f kodunu kullanarak karar verir.<\/p>\n<pre><code class=\"language-bash\">\ntest -f \"dosya.txt\"\necho $? # \u00c7\u0131k\u0131\u015f kodunu g\u00f6sterir (0 veya 1)\n<\/pre>\n<p><\/code><\/p>\n<h4><code>[<\/code> <code>]<\/code> ile Kolay Kullan\u0131m<\/h4>\n<p><code>[ ]<\/code> asl\u0131nda bir komuttur ve <code>test<\/code> komutunun e\u015fde\u011feridir. <code>[<\/code> komutu, son arg\u00fcman olarak <code>]<\/code> bekler. Bu nedenle, <code>[<\/code> ve <code>]<\/code> aras\u0131nda her zaman bo\u015fluk b\u0131rakmak zorunludur.<\/p>\n<pre><code class=\"language-bash\">\nif [ -f \"dosya.txt\" ]; then\n    echo \"dosya.txt mevcut.\"\nfi\n<\/pre>\n<p><\/code><\/p>\n<h4><code>[[<\/code> <code>]]<\/code> Geni\u015fletilmi\u015f Test<\/h4>\n<p>Bash'in modern s\u00fcr\u00fcmlerinde <code>[[ ]]<\/code> geni\u015fletilmi\u015f test yap\u0131s\u0131 tercih edilir. Bu yap\u0131, <code>[ ]<\/code>'e g\u00f6re baz\u0131 avantajlar sunar:<\/p>\n<ul>\n<li>Daha esnektir: Dize kar\u015f\u0131la\u015ft\u0131rmalar\u0131nda <code>==<\/code> ve <code>!=<\/code> gibi operat\u00f6rleri ve <code>&&<\/code>, <code>||<\/code> gibi mant\u0131ksal operat\u00f6rleri do\u011frudan kullanabilirsiniz, escape etmeye gerek kalmaz.<\/li>\n<li>Globbing (joker karakter e\u015fle\u015ftirme): <code>[[ \"$DEGISKEN\" == *.txt ]]<\/code> gibi joker karakter e\u015fle\u015ftirmeleri yapabilir.<\/li>\n<li>Kelime b\u00f6lme (word splitting) ve globbing'den ka\u00e7\u0131n\u0131r: De\u011fi\u015fkenleri t\u0131rnak i\u00e7ine alman\u0131za gerek kalmaz, ancak yine de iyi bir pratik olarak t\u0131rnak kullanmak \u00f6nerilir.<\/li>\n<\/ul>\n<pre><code class=\"language-bash\">\nif [[ \"merhaba\" == \"merhaba\" ]]; then\n    echo \"Dizeler e\u015fit.\"\nfi\n\nif [[ \"$DOSYA_ADI\" == *.log ]]; then\n    echo \"Bu bir log dosyas\u0131.\"\nfi\n<\/pre>\n<p><\/code><\/p>\n<h4>Yayg\u0131n Test Operat\u00f6rleri (Dosya, Dize, Say\u0131)<\/h4>\n<p>Daha \u00f6nce bahsetti\u011fimiz say\u0131sal ve dize kar\u015f\u0131la\u015ft\u0131rma operat\u00f6rlerinin yan\u0131 s\u0131ra, dosya \u00f6zelliklerini kontrol etmek i\u00e7in de operat\u00f6rler bulunur:<\/p>\n<table border=\"1\">\n<thead>\n<tr>\n<th>Operat\u00f6r<\/th>\n<th>A\u00e7\u0131klama<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>-d DOSYA<\/code><\/td>\n<td>DOSYA bir dizinse do\u011fru<\/td>\n<\/tr>\n<tr>\n<td><code>-e DOSYA<\/code><\/td>\n<td>DOSYA mevcutsa do\u011fru (dosya veya dizin)<\/td>\n<\/tr>\n<tr>\n<td><code>-f DOSYA<\/code><\/td>\n<td>DOSYA normal bir dosyaysa do\u011fru<\/td>\n<\/tr>\n<tr>\n<td><code>-r DOSYA<\/code><\/td>\n<td>DOSYA okunabilirse do\u011fru<\/td>\n<\/tr>\n<tr>\n<td><code>-w DOSYA<\/code><\/td>\n<td>DOSYA yaz\u0131labilirse do\u011fru<\/td>\n<\/tr>\n<tr>\n<td><code>-x DOSYA<\/code><\/td>\n<td>DOSYA y\u00fcr\u00fct\u00fclebilirse do\u011fru<\/td>\n<\/tr>\n<tr>\n<td><code>-s DOSYA<\/code><\/td>\n<td>DOSYA bo\u015f de\u011filse (boyutu s\u0131f\u0131rdan b\u00fcy\u00fckse) do\u011fru<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>En \u0130yi Uygulamalar ve Hata Ay\u0131klama<\/h3>\n<p>Bash betiklerinde ko\u015fullu ifadeleri kullan\u0131rken baz\u0131 en iyi uygulamalar\u0131 takip etmek, betiklerinizin daha g\u00fcvenilir ve bak\u0131m\u0131 kolay olmas\u0131n\u0131 sa\u011flar.<\/p>\n<h4>Kod Okunabilirli\u011fi<\/h4>\n<ul>\n<li><strong>Bo\u015fluk Kullan\u0131m\u0131:<\/strong> <code>[ ]<\/code> ve <code>[[ ]]<\/code> i\u00e7inde operat\u00f6rlerin ve de\u011ferlerin etraf\u0131nda bo\u015fluk b\u0131rakmay\u0131 unutmay\u0131n. \u00d6rne\u011fin: <code>[ \"$VAR\" -eq 5 ]<\/code> de\u011fil, <code>[ \"$VAR\" -eq 5 ]<\/code>.<\/li>\n<li><strong>T\u0131rnak \u0130\u015faretleri:<\/strong> De\u011fi\u015fkenleri her zaman \u00e7ift t\u0131rnak i\u00e7ine al\u0131n (<code>\"$DEGISKEN\"<\/code>). Bu, de\u011fi\u015fkenlerin bo\u015fluk veya \u00f6zel karakter i\u00e7ermesi durumunda hatalar\u0131 \u00f6nler.<\/li>\n<li><strong>Girinti:<\/strong> Kod bloklar\u0131n\u0131 (then, else, elif) girintilemek, beti\u011fin yap\u0131s\u0131n\u0131 ve okunabilirli\u011fini art\u0131r\u0131r.<\/li>\n<\/ul>\n<h4>Hata Mesajlar\u0131 ve \u00c7\u0131k\u0131\u015f Kodlar\u0131<\/h4>\n<p>Bir komutun ba\u015far\u0131yla tamamlan\u0131p tamamlanmad\u0131\u011f\u0131n\u0131 kontrol etmek i\u00e7in <code>$?<\/code> \u00f6zel de\u011fi\u015fkenini kullanabilirsiniz. Bu de\u011fi\u015fken, son \u00e7al\u0131\u015ft\u0131r\u0131lan komutun \u00e7\u0131k\u0131\u015f kodunu i\u00e7erir (0 ba\u015far\u0131, di\u011fer de\u011ferler hata).<\/p>\n<pre><code class=\"language-bash\">\ncp \/etc\/hosts \/tmp\/hosts_yedek\nif [ $? -eq 0 ]; then\n    echo \"Dosya ba\u015far\u0131yla yedeklendi.\"\nelse\n    echo \"Dosya yedeklenirken bir hata olu\u015ftu.\"\nfi\n<\/pre>\n<p><\/code><\/p>\n<h4>S\u0131k Kar\u015f\u0131la\u015f\u0131lan Hatalar<\/h4>\n<ul>\n<li><strong>Bo\u015fluk Eksikli\u011fi:<\/strong> <code>[ko\u015ful]<\/code> yerine <code>[ ko\u015ful ]<\/code> kullanmak.<\/li>\n<li><strong>T\u0131rnak Eksikli\u011fi:<\/strong> <code>[ $VAR = \"deger\" ]<\/code> yerine <code>[ \"$VAR\" = \"deger\" ]<\/code> kullanmak. E\u011fer <code>$VAR<\/code> bo\u015fsa veya bo\u015fluk i\u00e7eriyorsa hata verir.<\/li>\n<li><strong>Yanl\u0131\u015f Operat\u00f6r:<\/strong> Say\u0131sal kar\u015f\u0131la\u015ft\u0131rmalar i\u00e7in <code>=<\/code> yerine <code>-eq<\/code> kullanmak. <code>=<\/code> dize kar\u015f\u0131la\u015ft\u0131rmas\u0131 i\u00e7indir.<\/li>\n<li><strong><code>[[ ]]<\/code> ile <code>[ ]<\/code> Aras\u0131ndaki Farklar:<\/strong> \u00d6zellikle mant\u0131ksal operat\u00f6rleri (<code>&&<\/code>, <code>||<\/code>) kullan\u0131rken veya joker karakter e\u015fle\u015ftirmesi yaparken do\u011fru yap\u0131y\u0131 se\u00e7mek.<\/li>\n<\/ul>\n<h3>Sonu\u00e7<\/h3>\n<p>Bash betiklerinde ko\u015fullu ifadeler (<code>if<\/code>, <code>elif<\/code>, <code>else<\/code>), betiklerinizin karar verme yetene\u011fini art\u0131rarak onlar\u0131 \u00e7ok daha g\u00fc\u00e7l\u00fc ve esnek hale getirir. Dosya kontrollerinden kullan\u0131c\u0131 giri\u015fi do\u011frulamalar\u0131na kadar geni\u015f bir yelpazede kullan\u0131labilen bu yap\u0131lar, her Linux kullan\u0131c\u0131s\u0131n\u0131n ve sistem y\u00f6neticisinin bilmesi gereken temel ara\u00e7lard\u0131r. Do\u011fru s\u00f6z dizimini, test operat\u00f6rlerini ve en iyi uygulamalar\u0131 \u00f6\u011frenerek, daha sa\u011flam, verimli ve hata toleransl\u0131 Bash betikleri yazabilirsiniz. Bu bilgileri pratik yaparak peki\u015ftirmek, Bash betikleme becerilerinizi bir \u00fcst seviyeye ta\u015f\u0131yacakt\u0131r.<\/p>\n<h3>SSS (S\u0131k Sorulan Sorular)<\/h3>\n<h4>1. <code>[<\/code> ve <code>[[<\/code> aras\u0131ndaki temel fark nedir?<\/h4>\n<p><code>[<\/code> (tek k\u00f6\u015feli parantez), <code>test<\/code> komutunun bir k\u0131sayoludur ve POSIX standartlar\u0131na uygundur. Daha kat\u0131d\u0131r ve de\u011fi\u015fkenleri t\u0131rnak i\u00e7ine almay\u0131, mant\u0131ksal operat\u00f6rleri ayr\u0131 komutlar olarak (<code>-a<\/code>, <code>-o<\/code>) veya ayr\u0131 <code>test<\/code> komutlar\u0131 olarak kullanmay\u0131 gerektirir. <code>[[<\/code> (\u00e7ift k\u00f6\u015feli parantez) ise Bash'e \u00f6zg\u00fc geni\u015fletilmi\u015f bir test yap\u0131s\u0131d\u0131r. Daha esnektir, <code>==<\/code> gibi operat\u00f6rleri, joker karakter e\u015fle\u015ftirmeyi (<code>*.txt<\/code>), <code>&&<\/code> ve <code>||<\/code> gibi mant\u0131ksal operat\u00f6rleri do\u011frudan destekler ve kelime b\u00f6lme ile globbing'den daha az etkilenir. Genel olarak, modern Bash betiklerinde <code>[[<\/code> kullanmak daha g\u00fcvenli ve esnektir.<\/p>\n<h4>2. \u0130\u00e7 i\u00e7e <code>if<\/code> ifadeleri kullanabilir miyim?<\/h4>\n<p>Evet, Bash'te i\u00e7 i\u00e7e <code>if<\/code> ifadeleri kullanabilirsiniz. Bu, daha karma\u015f\u0131k ko\u015fullar\u0131 y\u00f6netmek i\u00e7in kullan\u0131\u015fl\u0131d\u0131r, ancak \u00e7ok fazla i\u00e7 i\u00e7e ge\u00e7irme kodun okunabilirli\u011fini azaltabilir. Genellikle, <code>if-elif-else<\/code> yap\u0131s\u0131 veya mant\u0131ksal operat\u00f6rler (<code>&&<\/code>, <code>||<\/code>) ile karma\u015f\u0131k ko\u015fullar\u0131 tek bir ifadede birle\u015ftirmek daha iyi bir yakla\u015f\u0131md\u0131r.<\/p>\n<h4>3. Bir de\u011fi\u015fkenin bo\u015f olup olmad\u0131\u011f\u0131n\u0131 nas\u0131l kontrol ederim?<\/h4>\n<p>Bir de\u011fi\u015fkenin bo\u015f olup olmad\u0131\u011f\u0131n\u0131 kontrol etmek i\u00e7in <code>-z<\/code> operat\u00f6r\u00fcn\u00fc kullanabilirsiniz:<\/p>\n<pre><code class=\"language-bash\">\nif [ -z \"$DEGISKEN\" ]; then\n    echo \"De\u011fi\u015fken bo\u015f.\"\nfi\n<\/pre>\n<p><\/code><br \/>\nVeya bo\u015f olmad\u0131\u011f\u0131n\u0131 kontrol etmek i\u00e7in <code>-n<\/code> operat\u00f6r\u00fcn\u00fc kullanabilirsiniz:<\/p>\n<pre><code class=\"language-bash\">\nif [ -n \"$DEGISKEN\" ]; then\n    echo \"De\u011fi\u015fken bo\u015f de\u011fil.\"\nfi\n<\/pre>\n<p><\/code><\/p>\n<h4>4. <code>if<\/code> ifadelerinde komutlar\u0131n \u00e7\u0131k\u0131\u015f kodunu kontrol etmek ne anlama gelir?<\/h4>\n<p>Linux'ta her komut, tamamland\u0131\u011f\u0131nda bir \u00e7\u0131k\u0131\u015f kodu (exit status) d\u00f6nd\u00fcr\u00fcr. <code>0<\/code> genellikle komutun ba\u015far\u0131yla tamamland\u0131\u011f\u0131 anlam\u0131na gelirken, <code>0<\/code> d\u0131\u015f\u0131ndaki herhangi bir de\u011fer bir hatay\u0131 veya ba\u015far\u0131s\u0131zl\u0131\u011f\u0131 g\u00f6sterir. <code>if<\/code> ifadeleri, ko\u015ful olarak bir komutu do\u011frudan \u00e7al\u0131\u015ft\u0131rabilir ve o komutun \u00e7\u0131k\u0131\u015f kodunu de\u011ferlendirebilir. \u00d6rne\u011fin:<\/p>\n<pre><code class=\"language-bash\">\nif grep \"hata\" \/var\/log\/syslog; then\n    echo \"Sistem g\u00fcnl\u00fc\u011f\u00fcnde hata bulundu.\"\nelse\n    echo \"Sistem g\u00fcnl\u00fc\u011f\u00fcnde hata bulunamad\u0131.\"\nfi\n<\/pre>\n<p><\/code><br \/>\nBurada <code>grep<\/code> komutu bir e\u015fle\u015fme bulursa <code>0<\/code> d\u00f6nd\u00fcr\u00fcr ve <code>if<\/code> blo\u011fu \u00e7al\u0131\u015f\u0131r. Bulamazsa <code>1<\/code> d\u00f6nd\u00fcr\u00fcr ve <code>else<\/code> blo\u011fu \u00e7al\u0131\u015f\u0131r.<\/p>\n<h4>5. <code>if<\/code> ko\u015fullar\u0131nda <code>(( ))<\/code> yap\u0131s\u0131n\u0131 ne zaman kullanmal\u0131y\u0131m?<\/h4>\n<p><code>(( ))<\/code> yap\u0131s\u0131, aritmetik i\u015flemler ve say\u0131sal kar\u015f\u0131la\u015ft\u0131rmalar i\u00e7in kullan\u0131l\u0131r. Bu yap\u0131, C benzeri s\u00f6z dizimi sunar ve aritmetik ifadeleri de\u011ferlendirmek i\u00e7in \u00e7ok kullan\u0131\u015fl\u0131d\u0131r. \u0130\u00e7inde de\u011fi\u015fkenlere <code>$<\/code> i\u015fareti koymaya gerek yoktur ve <code>==<\/code>, <code>><\/code>, <code><<\/code> gibi operat\u00f6rleri do\u011frudan kullanabilirsiniz.<\/p>\n<pre><code class=\"language-bash\">\nSAYI=10\nif (( SAYI > 5 && SAYI < 15 )); then\n    echo \"Say\u0131 5 ile 15 aras\u0131ndad\u0131r.\"\nfi\n<\/pre>\n<p><\/code><br \/>\nBu, \u00f6zellikle karma\u015f\u0131k matematiksel ko\u015fullar i\u00e7in <code>[ ]<\/code> veya <code>[[ ]]<\/code> kullanmaktan daha temiz ve verimlidir.<\/p>\n","protected":false},"excerpt":{"rendered":"Linux Temelleri &#8211; B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler)\nLinux sistemlerinde otomasyon ve verimlilik, Bash betiklerinin g\u00fcc\u00fcyle \u00f6nemli \u00f6l\u00e7\u00fcde &#8230;","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_page_header_type":"","csco_page_load_nextpost":"","csco_page_subscribe_form":"","csco_page_contact_form":"","footnotes":""},"categories":[1328],"tags":[],"class_list":{"0":"post-38588","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-bash","7":"cs-entry","8":"cs-video-wrap"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.5 (Yoast SEO v25.3.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Linux Temelleri - B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler) - Kodlar\u0131n Gizemli D\u00fcnyas\u0131<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux Temelleri - B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler)\" \/>\n<meta property=\"og:description\" content=\"Linux Temelleri - B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler) Linux sistemlerinde otomasyon ve verimlilik, Bash betiklerinin g\u00fcc\u00fcyle \u00f6nemli \u00f6l\u00e7\u00fcde ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/\" \/>\n<meta property=\"og:site_name\" content=\"Kodlar\u0131n Gizemli D\u00fcnyas\u0131\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-03T12:30:40+00:00\" \/>\n<meta name=\"author\" content=\"Fatih Soysal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fatih Soysal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/\"},\"author\":{\"name\":\"Fatih Soysal\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"headline\":\"Linux Temelleri &#8211; B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler)\",\"datePublished\":\"2026-02-03T12:30:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/\"},\"wordCount\":2241,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"articleSection\":[\"Bash\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/#respond\"]}],\"copyrightYear\":\"2026\",\"copyrightHolder\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/\",\"name\":\"Linux Temelleri - B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler) - Kodlar\u0131n Gizemli D\u00fcnyas\u0131\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\"},\"datePublished\":\"2026-02-03T12:30:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Anasayfa\",\"item\":\"https:\/\/fatihsoysal.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux Temelleri &#8211; B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/\",\"name\":\"Fatihsoysal.com\",\"description\":\"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim\",\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\",\"name\":\"Fatih Soysal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"contentUrl\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"width\":512,\"height\":512,\"caption\":\"Fatih Soysal\"},\"logo\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\"},\"description\":\"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Linux Temelleri - B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler) - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/","og_locale":"tr_TR","og_type":"article","og_title":"Linux Temelleri - B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler)","og_description":"Linux Temelleri - B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler) Linux sistemlerinde otomasyon ve verimlilik, Bash betiklerinin g\u00fcc\u00fcyle \u00f6nemli \u00f6l\u00e7\u00fcde ...","og_url":"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/","og_site_name":"Kodlar\u0131n Gizemli D\u00fcnyas\u0131","article_published_time":"2026-02-03T12:30:40+00:00","author":"Fatih Soysal","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"Fatih Soysal","Tahmini okuma s\u00fcresi":"14 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/#article","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/"},"author":{"name":"Fatih Soysal","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"headline":"Linux Temelleri &#8211; B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler)","datePublished":"2026-02-03T12:30:40+00:00","mainEntityOfPage":{"@id":"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/"},"wordCount":2241,"commentCount":0,"publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"articleSection":["Bash"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/#respond"]}],"copyrightYear":"2026","copyrightHolder":{"@id":"https:\/\/fatihsoysal.com\/blog\/#organization"}},{"@type":"WebPage","@id":"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/","url":"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/","name":"Linux Temelleri - B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler) - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/#website"},"datePublished":"2026-02-03T12:30:40+00:00","breadcrumb":{"@id":"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/fatihsoysal.com\/blog\/linux-temelleri-bolum-7-bash-betikleme-kosullu-ifadeler\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Anasayfa","item":"https:\/\/fatihsoysal.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Linux Temelleri &#8211; B\u00f6l\u00fcm 7: Bash Betikleme (Ko\u015fullu \u0130fadeler)"}]},{"@type":"WebSite","@id":"https:\/\/fatihsoysal.com\/blog\/#website","url":"https:\/\/fatihsoysal.com\/blog\/","name":"Fatihsoysal.com","description":"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim","publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1","name":"Fatih Soysal","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","contentUrl":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","width":512,"height":512,"caption":"Fatih Soysal"},"logo":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/"},"description":"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.","url":"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/"}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/38588","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/comments?post=38588"}],"version-history":[{"count":0,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/38588\/revisions"}],"wp:attachment":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/media?parent=38588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/categories?post=38588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/tags?post=38588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}