Skip to content

Instantly share code, notes, and snippets.

@hasayvaz
Created December 13, 2010 16:22
Show Gist options
  • Save hasayvaz/739167 to your computer and use it in GitHub Desktop.
Save hasayvaz/739167 to your computer and use it in GitHub Desktop.
sistem prog. odevi-ilk bölüm(Ad, Soyad, Numara ayırma)
#!/bin/bash
while read line; do
echo $line | awk -F, '{print $1}'
done < foo.txt > ad.txt
while read line; do
echo $line | awk -F, '{print $2}'
done < foo.txt > soyad.txt
while read line; do
echo $line | awk -F, '{print $3}'
done < foo.txt > numara.txt
@gdemir
Copy link

gdemir commented Dec 13, 2010

DRY (don't repeat yourself)
while read line; do
echo $line | awk -F, '{print $1}' >> ad.txt
echo $line | awk -F, '{print $2}' >> soyad.txt
echo $line | awk -F, '{print $3}' >> numara.txt
done < foo.txt

@hasayvaz
Copy link
Author

eyvallah kardeş, ama açık olsun diye öyle yapmıştım, yine de sağolasın ;)

@gdemir
Copy link

gdemir commented Dec 14, 2010

önemli değil :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment