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
2014/12/13「第14回東京居残りシェル芸勉強会」の解答例 | |
問題URL: http://blog.ueda.asia/?p=4671 | |
Togetterまとめ: http://togetter.com/li/757291 | |
A1: | |
echo 'define f(x){if(x<=1)return(1);return(f(x-1)*x)};f(100)' | bc | |
A2: |
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
#!/bin/bash | |
cat - | | |
tr a-z A-Z | | |
tr -cd A-Z2-7 | | |
tr A-Z2-7 0-9A-V | | |
fold -w1 | | |
sed \$s/$/\\\n/ | | |
while read _32; do echo $((32#$_32)); done | | |
while read _10; do echo obase=2\;$_10 | bc; done | | |
sed s/^/0000/g | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
cat input.csv | awk 'BEGIN{FS=","}NR==1{print "[";n=split($0,k)}NR>=2{for(i=1;i<=n;i++){r=r"\""k[i]"\":\""$i"\", "}{sub(/, $/,"",r);print " {"r"},";r=""}}' | sed '$s/,$/\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
#!/usr/bin/env bash | |
echo '<!DOCTYPE html>' > out.html | |
echo '<html><body><table border="1">' >> out.html | |
cat in.csv | | |
sed -e 's/^"""/"”/g' -e 's/,"""/,"”/g' | | |
sed -e 's/"""$/”"/g' -e 's/""",/”",/g' | | |
sed -e 's/""/”/g' | | |
tr ' ' '\a' | |
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
#!/bin/bash | |
# | |
# generate_gpl: Generate Pantone/DIC/TOYO-like GIMP palette file | |
# | |
# Written by KUSANAGI Mitsuhisa <[email protected]> / Date: 2014-02-25 | |
tmp=/tmp/$$ | |
case "$1" in | |
Pantone) |
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
#!/bin/bash | |
# | |
# rec_ustream_live: Recording live TV stream from Ustream | |
# | |
# Written by KUSANAGI Mitsuhisa([email protected]) / Date: 2012-09-03 | |
tmp=/tmp/$$ | |
ERROR_CHECK () | |
{ |
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/perl -w | |
use 5.005; | |
use strict; | |
BEGIN { unshift @INC, '.' } | |
use HTTP::Daemon; | |
use HTTP::Status; | |
use IPC::Open2; |
NewerOlder