Skip to content

Instantly share code, notes, and snippets.

@markogresak
Created January 30, 2015 14:54
Show Gist options
  • Save markogresak/6740d8543382de371f30 to your computer and use it in GitHub Desktop.
Save markogresak/6740d8543382de371f30 to your computer and use it in GitHub Desktop.
#!/bin/bash
# --- razno.sh ---
echo '#!/bin/bash'>razno.sh
chmod +x razno.sh
# razno.sh a)
echo '# naloga a)'>>razno.sh
echo 'echo "--- razno | naloga a) ---"'>>razno.sh
echo 'tail -8 datoteka | head -5'>>razno.sh
# razno.sh b)
echo '# naloga b)'>>razno.sh
echo 'echo "--- razno | naloga b) ---"'>>razno.sh
echo 'sort -u datoteka'>>razno.sh
# razno.sh c)
echo '# naloga c)'>>razno.sh
echo 'echo "--- razno | naloga c) ---"'>>razno.sh
echo 'cat /etc/passwd | wc -l'>>razno.sh
# razno.sh d)
echo '# naloga d)'>>razno.sh
echo 'echo "--- razno | naloga d) ---"'>>razno.sh
echo "awk -F':' '\$3>99 {print \$1 \"(\" \$3 \")\"}' /etc/passwd">>razno.sh
# razno.sh e)
echo '# naloga e)'>>razno.sh
echo 'echo "--- razno | naloga e) ---"'>>razno.sh
echo 'cat /etc/passwd | grep /bin/false | tr ":" "\t" | nl'>>razno.sh
# razno.sh h)
echo '# naloga h)'>>razno.sh
echo 'echo "--- razno | naloga h) ---"'>>razno.sh
echo 'tail -8 datoteka | tee output | head -5'>>razno.sh
# --- regex.sh ---
echo '#!/bin/bash'>regex.sh
chmod +x regex.sh
# regex.sh a)
echo '# naloga a)'>>regex.sh
echo 'echo "--- regex | naloga a) ---"'>>regex.sh
echo 'egrep "^a" datoteka'>>regex.sh
# regex.sh b)
echo '# naloga b)'>>regex.sh
echo 'echo "--- regex | naloga b) ---"'>>regex.sh
echo 'egrep "\<a" datoteka'>>regex.sh
# regex.sh c)
echo '# naloga c)'>>regex.sh
echo 'echo "--- regex | naloga c) ---"'>>regex.sh
echo 'egrep "\<...\>" datoteka'>>regex.sh
# regex.sh d1)
echo '# naloga d1)'>>regex.sh
echo 'echo "--- regex | naloga d1) ---"'>>regex.sh
echo 'egrep "\<(a|b)..\>" datoteka'>>regex.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment