シェルスクリプトをServerspecとVagrantで継続的インテグレーションする @ Glory Web Infra http://peatix.com/event/71002

November 01, 201011:48 カテゴリプログラム 本物の shell プログラマは old-style backquote を使用しない shell スクリプト書いた事のある人は、old-style backquote を使用した事があると思う。 コマンドを ` でくくる、あれだ。 例えば、1から 10までの数字を表示したければ、以下のようにすればよい $ for i in `seq 10`; do > echo $i done では、文字列をエスケープする時はどうだろう。 最初に、'a^a$a' という文字列から '^' と '$' をエスケープした文字列を表示させる場合を考えよう (ここでは、` は使う必要がない) echo 'a^a$a' | sed 's/\^/\\^/g; s/\$/\\$/g' では、先ほどと同じ文字列 'a^a$a' から "^" と '$'
test と [ と [[ コマンドの違い - 拡張 POSIX シェルスクリプト Advent Calendar 2013 - ダメ出し Blog 拡張 POSIX シェルスクリプト Advent Calendar 2013、15日目の記事です。 書くのが遅れ、ネタは尽きかけ、 マニアックさやニッチさが足りなくなってきているような気がします。 ふつうの内容ですみません。 今日は test, [, [[ コマンドの違いについてざっくり紹介します。 [[ がある bash, ksh, zsh ならば test と [ の使用は避け、 [[ を使用すべきです。 [ は慎重に使わないと様々な罠にかかるため危険です。 (翌日のネタも併わせてどうぞ) test と [ の違い どちらもシェルの組込みコマンドです。名前が違うのと [ は最後の引数を ] にしなければいけない縛りがある以外、 動作まった
A Unix Shell in Ruby Published on February 16, 2012 by Jesse Storimer This is the first article in a series where I'll implement a Unix shell in pure Ruby code. Why a shell? A shell is the quintessential example of a Unix program. It hits all of the interesting points that a Unix system is capable of. It has to read input from STDIN, spawn processes requested from users, send signals to processes
🐧 nixCraft → Linux → 10 Tools To Add Some Spice To Your UNIX/Linux Shell Scripts There are some misconceptions that shell scripts are only for a CLI environment. You can efficiently use various tools to write GUI and network (socket) scripts under KDE or Gnome desktops. Shell scripts can make use of some of the GUI widget (menus, warning boxes, progress bars, etc.). You can always control the fin
皆さん今日もたくさんのサーバを相手にされていることかと思いますが、いくつかのサーバにアクセスして 1 秒間の統計情報(例えばvmstat 1 2)を集めてパッと表示したい時ってどうやってますかね?shell script を学びはじめたばっかりの僕はこんな感じで書いてました。 $ for i in host1 host2 host3; do ssh $i "vmstat 1 2 | tail -1"; done 0 0 0 329004 210836 14275360 0 0 0 2424 1410 1828 0 0 100 0 0 0 0 0 3716112 587704 25921684 0 0 0 488 1643 2026 0 0 100 0 0 1 0 0 555440 265560 14015548 0 0 0 4204 1534 2392 1 0 99 0 0 vmstatと
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く