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
#!/usr/bin/env python3 | |
#coding: utf-8 | |
for x in range(1, 100): | |
flag = x > 1 | |
for y in range(2, x+1): | |
if x % y == 0: | |
if x != y: | |
flag = 0 | |
break | |
print('jojo!!' if flag else x) |
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
cut -d":" -f1 /etc/passwd |
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
cut -d":" -f7 /etc/passwd | grep -E '(sh$|in$)' | sort | uniq -c |
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
grep -r '#!/bin/bash' /etc 2> /dev/null | sed 's/:.*$//' | while read line;do sed 's;#!/bin/bash;#!/usr/local/bin/bash;' $line > ~/hoge/$(basename $line) ;done |
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
awk '{print int($1/10)}' ages | sort -n | uniq -c | awk '{print $2*10"〜"$2*10+9,$1}' |
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
seq 1 16 | awk '{if($1%15==0){print "FizzBuzz"}else if($1%3==0){print "Fizz"}else if($1%5==0){print "Buzz"}else{print $1}}' | tr '\n' ',' |
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
ls [!a-zA-z]* | xargs rm |
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
expr $(cat nums | tr "\n" " " | sed 's/ $//' | sed 's/ / + /g') |
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
for i in a b ; do grep $i hoge | sort -k2n | tail -1; done |
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
sort -k1,1 num2 | yarr num=1 | sed 's/[ab] //g' | sed 's/ / + /g' | bc |
OlderNewer