$ bash --version
GNU bash, version 4.3.46(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
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 | |
set -u | |
argtest() { | |
printf '$@: ' | |
echo "$@" | |
printf '$# ' | |
echo $# | |
printf '$1 ' | |
echo $1 ;shift |
่ชญใฟ่พผใฟใๆธใ่พผใฟๆจฉ้ใฎใฟใงใๅฎ่กๆจฉ้ใใชใ็ถๆ ใฎใใฃใฌใฏใใช(drw-)ใฎๅไฝใๆฐใซใชใฃใใฎใงใกใขใ่ฒใ ๆค็ดขใใฆใใใฎใฑใผในใฏ็กใใฃใใฎใงใ ใใใใใwใใคใใฆใฆxใใคใใฆใชใใใฃใฌใฏใใชใฃใฆใฟใชใใชใจๆใฃใใฎใงใ
Dockerใณใณใใใงๆค่จผ ใคใกใผใธใฏubuntu:16.04
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
ใฆ ใ ใ ใ ใช ใ ใ ใ ใ ใต ใ ใ ใ ใท ใฉ | |
ใ ใด ใฉ ใ ใฎ ใ ใ ใฑ ใ ใซ ใค ใ ใ ใ ใ | |
ใ ใ ใ ใผ ใ ใต ใ ใจ ใ ใ ใ ใ ใ ใ ใ | |
ใ ใ ใ ใญ ใ ใฝ ใ ใถ ใ ใ ใ ใ ใ ใ ใ | |
ใ ใจ ใต ใ ใ ใ ใด ใ ใช ใพ ใณ ใ ใ ใต ใ | |
ใฅ ใ ใก ใ ใ ใ ใ ใ ใ ใ ใญ ใค ใช ใ ใ | |
ใ ใ ใ ใ ใถ ใฏ ใ ใค ใ ใ ใ ใ ใ ใ ใ | |
ใฌ ใ ใ ใ ใ ใ ใค ใฏ ใพ ใ ใก ใ ใ ใญ ใ | |
ใ ใท ใ ใต ใ ใ ใ ใ ใ ใ ใ ใฉ ใ ใ ใ | |
ใธ ใ ใ ใค ใ ใฉ ใก ใ ใ ใ ใ ใ ใท ใ ใ |
parse1() {
echo "$1"
shift
parse2 "$@"
echo "$1"
}
parse2() {
echo "$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
import /usr/bin/ as ub | |
proc cure = /usr/local/bin/docker 'run' '-i' 'greymd/cureutils' 'cure' argv[1] | |
proc cure_date_stdin = /usr/local/bin/docker 'run' '-i' 'greymd/cureutils' 'cure' 'date' '-f' '-' argv[1] | |
ub.seq '1' '365' >>= | |
ub.sed 's/$/ days ago/' >>= | |
this.cure_date_stdin '+%F @P' >>= | |
this.cure 'grep' >>= | |
ub.sed 's|/.*$||' >>= ub.head |
tree -f
ใงใใใใใใจใใ่ฉฑใ
$ tree test | awk 'NF{depth=gsub("[โโโ]","&",$0); if(last_depth < depth){dirs[depth]=last_dir;}else if(last_depth > depth){dirs[last_depth]="";} last_dir=$NF;last_depth=depth;pdir=".";for (i in dirs){pdir=pdir"/"dirs[i];} gsub("/$","",pdir);$NF=pdir"/"$NF;print}' | sed '$d'
Preparation
$ mkdir test/{aaa,bbb}
$ touch test/aaa/{aaa1,aaa2,aaa3}
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
$ curl -so- https://ftp.gnu.org/gnu/bash/ | perl -nle '/(bash-.*?tar.gz)/ and print $1' | grep -v doc | uniq | |
bash-1.14.7.tar.gz | |
bash-2.0.tar.gz | |
bash-2.01.1.tar.gz | |
bash-2.01.tar.gz | |
bash-2.02.1.tar.gz | |
bash-2.02.tar.gz | |
bash-2.03.tar.gz | |
bash-2.04.tar.gz | |
bash-2.05.tar.gz |
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
$ git tag | grep -E 'curl-[0-9]+_[0-9]+_[0-9]$' | awk -F'_' '{if(!a[$1_$2]){print} a[$1_$2]++}' | tr '_' ' ' | sort -k1,1n -k2,2n -k3,3n | tr ' ' '_' | |
curl-7_1_1 | |
curl-7_4_1 | |
curl-6_5_1 | |
curl-7_5_2 | |
curl-7_6_1 | |
curl-7_7_1 | |
curl-7_8_1 | |
curl-7_9_1 | |
curl-7_10_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
# CentOS | |
$ yum install autoconf automake libtool libtool-ltdl openssl-devel tar | |
$ curl -sL https://github.com/curl/curl/archive/curl-7_20_0.tar.gz | tar zxv | |
$ cd curl-curl-7_20_0/ | |
$ ./buildconf | |
$ ./configure --enable-libcurl-option | |
$ make && make install | |
# Ubuntu | |
$ apt-get update |