A B C D E å é 2è¡ãèªã¿é£ã°ã ï¼ 3è¡ç®ãã表示ãã $ tail -n +3 hoge.txt C D E å¾ã2è¡ãèªã¿é£ã°ã ï¼ å¾ã2è¡ãèªã¿é£ã°ã $ head -n -2 hoge.txt A B C
A B C D E å é 2è¡ãèªã¿é£ã°ã ï¼ 3è¡ç®ãã表示ãã $ tail -n +3 hoge.txt C D E å¾ã2è¡ãèªã¿é£ã°ã ï¼ å¾ã2è¡ãèªã¿é£ã°ã $ head -n -2 hoge.txt A B C
ããã¯ã¿ã¼ããã«ã§ã®ã³ã¼ãã£ã³ã°ãä»äºã®å¤§ããªé¨åã«ãªã£ã¦ãã人ã«ã¨ã£ã¦ãå°ããã§ãããã¨ã¦ã便å©ãªä»çµã¿ã Noti ã¯ã¿ã¼ããã«ããã»ã¹ãçµäºããã®ãå¾ ã£ã¦ãOSX / Linux ãã·ã³ä¸ã§å°ããªéç¥çªã表示ãã¾ããå¦çã«é·ãæéããããã³ãã³ããå ¥åããéã«ããããçµããã®ããã¨ãåæ°ç§ã§ãã£ã¦ãã¼ãã£ã¨å¾ ã£ã¦ããå¿ è¦ã¯ããã¾ãããããã»ã¹ãçµäºãã㨠Noti ãé³ã¨ã¨ãã«éç¥ãçºçããã¾ãã æ°ç§ä»¥ä¸ã®å¾ ã¡æéãæå¹æ´»ç¨ ãã¨ãã°ã¡ãã£ã¨å¤§ããã®ãã£ã¬ã¯ããªã§ tar ã³ãã³ãã§ãã¡ã¤ã«ããããã¦ããéãªã©ã«ãçµäºã¾ã§ãã°ããæéãããã¨ãã¼ãã£ã¨å¾ ã£ã¦ããã®ãç¡é§ã§ããããçµãã£ãããªãã¨ãã¡ãã¡ã¦ã£ã³ãã¦ãè¦ã«è¡ãã®ãé¢åãªãã¨ã§ããnoti ã使ãã°ï¼ noti tar -cjf music.tar.bz2 Music/ ã¨ããä¸è¡ã®ã³ãã³ãã§éç¥ãçºçãã¦ãããã¢ããã
ä»ã®äººãzshã使ã£ã¦ããã®ãè¦ã¦ããã¨ãããã£ã¨ä¾¿å©ã«ä½¿ããã®ã«ãã¨ãããã£ã¨ããããããããã®ä¾¿å©ãªæ©è½ã£ã¦ãªã«ï¼ãã¨ãçºè¦ããã£ãããã¾ããã ããã«ããã®è¨å®ãããã¨ä¾¿å©ã§ãããã¨è©±ããããããããã«ãä»ã®zshã®ããããè¨å®ãããã«è¨ãã¦ããã¾ãã ãããEmacsã使ã£ã¦ããå ´åã¯ããããEmacsè¨å®ãã©ããã ãã£ã¬ã¯ããªæ§æ é·å¹´æ¼¬ãè¾¼ãã§ããzshã®è¨å®ãããããã®éã«ãªã£ã¦ããã®ã§ã以ä¸ã®ãããªãã£ã¬ã¯ããªæ§æã«ãã¦åé¡ãã¦ãã¾ãã主ã«ãzshæ¨æºæ©è½ã®è¨å®ã¨è¿½å ããã±ã¼ã¸ã®è¨å®ãåããããã«ãããã¦ãã¾ãã ~ âââ .zshrc # ã·ã§ã«ãèµ·åããæ¯ã«èªã¿è¾¼ã¾ããã â # ~/.zsh.d/zshrcãèªã¿è¾¼ã㧠â # æ¨æºæ©è½ã®è¿½å è¨å®ãè¡ãã âââ .zshenv # ãã°ã¤ã³æã«ä¸åº¦ã ãèªã¿è¾¼ã¾ããã â # ~/.zsh.d/zshenvãèªã¿è¾¼ã
direnv direnv ã¯ãç¹å®ã®ãã£ã¬ã¯ããªã«ç§»åããã¨ãã®ã¿ç°å¢å¤æ°ãæå¹åãããã¼ã«ã§ããã¢ããªãã¨ã«ç°å¢å¤æ°ãå¤æ´ãããã¨ãã«ä¾¿å©ãªã¢ã¤ãã ã§ããã¡ãªã¿ã«ãè¨èªã¯ Go ã§éçºããã¦ããããã§ãã ç§ã¯ãMiddleman ã§éç Web ãµã¤ãã S3 ã«ãããã¤ããã¨ã (ã¡ãªã¿ã« middleman-s3_sync ã¨ãã ä¾¿å© Gem) ã® AWS ã®ã¢ã¯ã»ã¹ãã¼ã¨ã·ã¼ã¯ã¬ãããã¼ãè¨å®ããã¨ãã«ä½¿ãã¾ãããé¡ä¼¼ãã¼ã«ã« Dotenv ãããã¾ããããã¡ãã¯ç°å¢å¤æ°ãæå¹åããããã« Dotenv.load ãå®è¡ããå¿ è¦ãããã¾ããdirenv ã¯ãã£ã¬ã¯ããªã«ç§»åãã¦ããã¿ã¤ãã³ã°ã§èªåã§æå¹åãã¦ããã¦æ¥½ã ã£ãã®ã§ãã£ã¡ãæ¡ç¨ãã¾ãããã©ã¡ããè¯ããã¯éçºç°å¢ã«ä¾ãããªãã¨æãã¾ãã direnv ã使ãã æ©é使ã£ã¦ã¿ã¾ããããMac ã®å ´å㯠Homebrew
ãããè¨äºãé·ããããç°¡åãªã¢ã¦ãã©ã¤ã³ãæ¸ãã¦ããã¾ããè¦ç¹ã ãæ´ã¿ããå ´åã¯ãæçµé ã®ãã¾ã¨ãããèªãã®ãããããããã¾ããã ã³ãã³ãã©ã¤ã³å¼æ°ã®ä¸è¬çãªè§£æææ³ ããããã®ç¹å¾´ ã getopt 㨠getopts ã®éã getoptsï¼ã¡ãªããã»ãã¡ãªããï¼ getoptï¼ã¡ãªããã»ãã¡ãªããï¼ èªåã§è§£æãã¡ããï¼å¯ä¸ã®ãã¡ãªããï¼ ã¾ã¨ã ============================= ã³ãã³ãã©ã¤ã³å¼æ°ãå¦çããä¸è¬çãªææ³ã¨ãã¦ã getopts getopt shift ãªã©ã§èªåã§è§£æ ã¨ãã£ãå ·åã«ãä¸ããé ã«èãã¤ããã¨æãã¾ããgetopt(3) 㯠UNIX ã«ããã¦ãã³ãã³ãã®å¼æ°ãå¦çããä¸è¬ç㪠C è¨èªã®ã©ã¤ãã©ãªé¢æ°ã§ãããããç¨ãã¦å®è£ ãããã³ãã³ãã getopt(1) ã§ããBourne ã·ã§ã«ç³»ã ã¨å é¨é¢æ°ã«ãªãã¾ãããå系統ã®
ãã³ã°ãªãã·ã§ã³ï¼--tmpdir /tmp ã¿ãããªãã¤ï¼ã欲ããã¨æã£ããã¨ã¯ãªãã£ãã®ã§ããããã®æ¥æ¸ãã¦ããã¹ã¯ãªããã«ãæå³ãããç解ãã¦æ³¨æãã¦æå®ãã¦æ¬²ãããªãã·ã§ã³ãå®è£ ãããã¨ãã¦ãã¦ãããããå±é¢ã§ã¯ãã³ã°ãªãã·ã§ã³ã使ãã®ãããã®ã§ã¯ï¼ã¨æãè³ãã¾ããã ããã§ãã¾ãã¯ç·´ç¿ã¨ãã¦ãåã«æ¸ãããã³ãã¬ã¼ã(getoptã使ãç)ãæ¡å¼µãã¦ããã³ã°ãªãã·ã§ã³ã«å¯¾å¿ãã¦ã¿ã¾ããã #!/bin/bash # # getopt-long-template.bash (use getopt utility) # export LANG=C usage_exit() { echo "Usage: getopt-long-template.bash [-a] [-d dir] [--extra] [--file f] item1 item2 ..." 1>&2 exit 1 } #
SpiderMonkey 㧠JavaScript ã®ã¤ã³ã¿ã©ã¯ãã£ãã·ã§ã« JavaScript ã®ã³ã¼ããã¤ã³ã¿ã©ã¯ãã£ãã«åããããã¼ã« (Ruby ã«ããã irb ã®ãããªãã®) ã欲ããã¨ä»¥åããæã£ã¦ããã®ã§ãããä»æ¥ã«ãªã£ã¦ãããã SpiderMonkey ã®ã¤ã³ã¿ã©ã¯ãã£ãã·ã§ã«ãã¤ã³ã¹ãã¼ã«ãã¾ããã Debian GNU/Linux ãªã sudo apt-get install spidermonkey-bin ãå®è¡ããã ãã§ã¤ã³ã¹ãã¼ã«ã§ãã¾ããã¤ã³ã¹ãã¼ã«å¾ã js ã³ãã³ããå®è¡ããã¨ã¤ã³ã¿ã©ã¯ãã£ãã·ã§ã«ãç«ã¡ä¸ããã¾ãã å¼ãå ¥åããã¨å¤ã表示ããã¾ãã readline ã©ã¤ãã©ãªããªã³ã¯ããã¦ããã®ã§ãã³ãã³ãã©ã¤ã³ç·¨é㯠bash ã¨åæ§ã«ã§ãã¾ãã js> a = [1,2,3] 1,2,3 js> a.push(4) // æ«å°¾ã« 4 ã追å
é常ãã®åéã«ãããã¯ã³ã©ã¤ãã¼ï¼one-linerï¼ã¨ã¯ããã¤ãï¼|ï¼ã¨ããæ©è½ãç¨ãã¦è¤æ°ã®ã³ãã³ãã1è¡ã«ã¾ã¨ãããã®ãæå³ããããã¤ãã®æ©è½ã¯ããã®å·¦å´ã«è¨è¿°ãããã³ãã³ãã®å®è¡çµæããå³å´ã«è¨è¿°ãããã³ãã³ãã®å ¥åã¨ãã¦æ¸¡ããã¨ã§ãããæ¬ç¨¿ã§è§£èª¬ããã®ã¯bashã³ãã³ãããã³ããã§ã®ä½¿ç¨ä¾ã ããç°¡åãªæ§æã®ã¯ã³ã©ã¤ãã¼ã«ããè¤éãªæ§æã®ã¯ã³ã©ã¤ãã¼ã«ããããããã¯ãããã使ãæ¹æ¬¡ç¬¬ã§å¤§ãã«å½¹ç«ã¤åå¨ãªã®ã ã ä¾ãã°ãã«ã¬ã³ãã®ãã£ã¬ã¯ããªã«ä½åã®ãã¡ã¤ã«ãç½®ããã¦ãããã確èªããã«ã¯ãä¸è¨ã®ã³ãã³ããå®è¡ããã°ããã ls | wc -l ããã¯æãç°¡åãªé¨é¡ã«å±ãã¯ã³ã©ã¤ãã¼ã®ãµã³ãã«ã§ãã£ã¦ãç¶æ³ã«ãã£ã¦ã¯ããè¤éãªè¨è¿°ããããã¨ã«ãªããä¾ãã°ãæå ã®ã·ã¹ãã ã«ã¦å®è¡ä¸ã®ããã»ã¹ã®ãã¡ã§CPUæéãæ大éã«æ¶è²»ãã¦ãããã®ä¸ä½5ã¤ãç¹å®ããã«ã¯ãä¸è¨ã®ã³ãã³ããå®è¡ããã°ãã
CodeZineç·¨éé¨ã§ã¯ãç¾å ´ã§æ´»èºãããããããã¼ãã¹ã¿ã¼ã«ããããã®ã«ã³ãã¡ã¬ã³ã¹ãDevelopers Summitãããã¨ã³ã¸ãã¢ã®çããã¾ããã¼ã¹ãããããã®ã¤ãã³ããDevelopers Boostããªã©ããã¾ãã¾ãªã«ã³ãã¡ã¬ã³ã¹ãä¼ç»ã»éå¶ãã¦ãã¾ãã
ãã¾ããããªãæ¥ã«ä»è¾¼ãã©ã ããããä»æ¥ã®ããããã¡ãã¡ã â¦ã ããããæ¥ã¯ä½ãã§åãè¿ããããªããé·ã ã¨å¤æ´ãããã¦æ¬ãèªãã ããåºç¹ããããâ¦æ¥ä¸ã®èªåã®ãã¹ãåãæ»ããå¦ããæå³ã®ãããã¨ãããããªãã®ã§ãã ãã¾ããããªãã£ãæ¥ã®ãããã®æè¿ã®ãªãã³ã¸æ¹æ³ãç¾å³ããã©ããâ¦
ã¿ã¤ãã«ã®éãã§ãããxargsã³ãã³ãã®ä¾¿å©ããç´¹ä»ããè¨äºãæ¸ãã¦ã¿ã¾ãããxargsã¯ç§ã大好ããªã³ãã³ãã®ä¸ã¤ã§ãæ¨æºå ¥åãã渡ããããã¡ã¤ã«åãªã©ãå¼æ°ã¨ã¿ãªãã¦ãå¥ã®ã³ãã³ãã®å¼æ°ã¨ãã¦èµ·åããã¨ãããã®ã§ãã ä¾ãã°findã§è¦ã¤ãããã¡ã¤ã«ãå ¨é¨åé¤ãããå ´åãxargsãªãã§ãä¸è¨ã®ããã«æ¸ããã¨ãã§ãã¾ãã
æè¿ãä¼ç¤¾ã§ã·ã§ã«ã®æä½æ¹æ³ã«ã¤ãã¦æãã¦ããã®ã ãã pgrep / pkill / skill / pidof ã¨ãã£ã 便å©ãªããã»ã¹æä½ç³»ã³ãã³ããç¥ããªã人ãå®ã«å¤ãã ããã»ã¹ã殺ãã¨ããã®ã¯ãããããä½æ¥ãªã®ã§ ä»åã¯ã³ã¬ã«ã¤ãã¦æ¸ãã¦ã¿ãã ãã¨ãã°ããããã®ã³ãã³ããç¥ããªã人ãã æå®ããååã®ããã»ã¹ã kill ããæé ã¯ã ããã 以ä¸ã®ãããªãã®ã«ãªããã¨ã ããã $ ps aux | grep ããã»ã¹å | grep -v 'grep' # ã³ãã³ãã®åºåçµæãã pid ãç®ã§ç¢ºèª 12345 ... .. hoge .. .. $ kill 12345 ãã®ä½æ¥ã¯é常ã«é¢åã§éå±ã ã ãã殺ããªããã°ãªããªãããã»ã¹ããããããã£ãã¨ã㯠ã©ãããã®ã ãããã ãã¾ãã«ãgrep ã³ãã³ãèªèº«ãåè£ã«å«ã¾ãã¦ãã¾ãäºãããã®ã ãã grep -v grep
FreeBSD ç¨ã® zsh è¨å®ãã¡ã¤ã«ã®ä¾ãå ¬éãã¦ãã¾ãã[ last-update: 2008.06.22 ] ã®ããã æåã«ãã®ææ¸ãå ¬éãã¦ããï¼å¹´ãéãã¦ãã¾ããèªåã®è¨å®ãã¡ã¤ã«ãä½ãå§ãã¦ããããï¼ï¼å¹´ã§ãï¼ï¼ï¼ãzsh ã¯æ¥ã 使ã£ã¦ãã¾ãããããã®è¨å®ãã¡ã¤ã«ã¯ä»ãæ´å²ã®å½¼æ¹ã«ãã zsh 3.x ã®ãã®ããã¼ã¹ã«ãã¦ãã¾ããã¡ããã¨è¨å®ãããæ¹ã¯ãä»ã®ãµã¤ããåç §ãããããé¡ããã¾ãã æ§ã®ããã å ¨ç¶ï¼ï¼å¹´ãããï¼ã¡ã³ããã¦ããªãã®ã«ãªããæªã ã«åæã§ç´¹ä»ããã¦ãããããªã®ã§ãã¡ãã£ã¨ã ããããã«ãã¾ããããã¯ã FreeBSD ã¯ãã¾ãé¢ä¿ãªããªã£ã¦ãã¾ãããå½¹ã«ç«ã¤ã®ã§ããã°å¹¸ãã§ãã æ§æ§ã®ããã ããã«ã¡ã¯ãUNIX ã¯ãã¼ã³ OSãFreeBSD ã®åå¿è ã¦ã¼ã¶ and/or ããã¢ãªããªãï¼ãã¶ãï¼ã®ããã® zsh è¬åº§ã®æéããã£ã¦ã¾ããã¾ãããã¨ã
ãJava BlockingQueueã§éã¶ï¼ãã¤ãã©ã¤ã³ãã£ããã§ãã¤ãã©ã¤ã³ã®è©±ãããã®ã§ãæ¬æ¥ã®ãã¤ã¾ãUnixã®ãã¤ãããªãã¤ã¬ã¯ããå°ã調ã¹ã¦ã¿ã¾ããã ãã¾ã«è©±é¡ã¨ãªã some-command >file 2>&1 㨠some-command 2>&1 >fileã®æåã®éãã«ã¤ãã¦ããã·ã§ã«ã¯ã³ãã³ãã©ã¤ã³ãªãã¤ã¬ã¯ãã®æå®ãå³ããå·¦ã«è§£éå®è¡ããããªãã¦èª¬æãè¦ã¤ããã¾ãããããªãã«ãªï¼ ãã¼ã¸ã³ã°ã¯å·¦ããå³ã«ãããã®ã§ããããã¼ãºããªã¼ãéé ã«ãã©ããã¨ã¯ã§ãããã©ããããªãã¨ããå¿ ç¶æ§ã¯ãªãã«ããªããã 次ã®è¨äºãèªãã¨ããå³ããå·¦ããªãã¦äºæ ãããªããã¨ãåããã§ãããã UNIXã®é¨å± æ¤ç´¢: ãªãã¤ã¬ã¯ã ã·ã§ã«ã®ãªãã¤ã¬ã¯ãã«ã¾ã¤ãã失æ ãã¦ããã§ã¯ãè¤éãªãªãã¤ã¬ã¯ãå¦çãå®å ¨ã«ç解ã§ããå¦æ¹ç®ã示ãã¾ããããä¾ãã°ã次ã®ã³ãã³ãã©ã¤ã³ãä½ããããåãã
ããã¼ããã¾ã¾ã§ãã¤ãã¨ãªãã¤ã¬ã¯ãå ¨ç¶åãã£ã¦ãªãã£ããã ããã é©å½ã«ä½¿ã£ã¦ã¾ãããã©ãã·ã§ã«ã®ãªãã¤ã¬ã¯ãããããããã®ãªããã¨ãããããå®å ¨ã«ç解ããã - æªå±±æ£å¹¸ã®ããã¤ã©é£¼è²è¨èªãã§ããã£ããã¼ã 以ä¸ãç解ã®ããã«è²ã èãã¦ã¿ããã¨ã ã¡ãªã¿ã«ã以ä¸ã®ä¾ã§å ¥åãã¡ã¤ã«ãprototype.jsãªã®ã¯ãã¾ãã¾ãã®å ´ã«ãã£ããããå ¨ãæ·±ãæå³ã¯ç¡ãã UNIXã®ä¸è¬çãªShellã ã¨ã 0çªç®ã®ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãã³ãã³ãã«å¯¾ããå ¥åã«ä½¿ã 1çªç®ã®ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãã³ãã³ãã®çµæ表示ã«ä½¿ã 2çªç®ã®ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãã³ãã³ãã®ã¨ã©ã¼åºåã«ä½¿ã ã¨ãªã£ã¦ãããããã©ã«ãã§ãããã¯ä»ã¾ã§ãè¯ãèãã¦ããã ã¡ãªã¿ã«ããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã£ã¦ãªã«ï¼ã£ã¦æãã ã£ãã®ã ãã©ããã¼ã¿ãåºãå ¥ãéã°ãããããã¼ã¹ã¿ãããªæ©è½ãæã£ããã®ãæ³åããã ã¨ãããããæåã«ãã
ãµã¼ãã¹çµäºã®ãç¥ãã ãã¤ãYahoo! JAPANã®ãµã¼ãã¹ããå©ç¨ããã ãèª ã«ãããã¨ããããã¾ãã ã客æ§ãã¢ã¯ã»ã¹ããããµã¼ãã¹ã¯æ¬æ¥ã¾ã§ã«ãµã¼ãã¹ãçµäºãããã¾ããã ä»å¾ã¨ãYahoo! JAPANã®ãµã¼ãã¹ããæ顧ãã ããã¾ãããããããããé¡ããããã¾ãã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}