[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
サービスの一覧を表示 # systemctl list-unit-files -t service 起動 # systemctl start sshd.service 停止 # systemctl stop sshd.service 状態確認 # systemctl is-active sshd.service 詳細な状態確認 # systemctl status sshd.service 自動起動の設定をONに変更 # systemctl enable sshd.service 自動起動の設定をOFFに変更 # systemctl disable sshd.service
起動 # service sshd start または # /etc/rc.d/init.d/sshd start 停止 # service sshd stop または # /etc/rc.d/init.d/sshd stop 状態確認 # service sshd status または # /etc/rc.d/init.d/sshd status 自動起動ON # chkconfig sshd on 自動起動OFF # chkconfig sshd off
* 関数の定義のテンプレート /** * @param int $var1 * @param string $var2 * @return ..... */ function funcSample($var1, $var2) { return false; } ##2014-11-03_mon test.txt * 適当な文字列 * あいうえお * かきくけこ * さしすせそ ##2014-11-04_tue * memo:xx-xxxx-xxxx ##2014-11-05_wed * なにかてきとうな文字列 * ・・・・・・ ##2014-11-06_thu * * * *
#!/bin/bash csplit -z -f "test-" -b "%05d.txt" test.txt /^##[0-9][0-9][0-9][0-9].*$/ {*}
使用法: csplit [オプション]... ファイル パターン... Output pieces of FILE separated by PATTERN(s) to files `xx00', `xx01', ..., and output byte counts of each piece to standard output. 長いオプションに必須の引数は短いオプションにも必須です. -b, --suffix-format=FORMAT use sprintf FORMAT instead of %02d -f, --prefix=PREFIX use PREFIX instead of `xx' -k, --keep-files do not remove output files on errors -n, --digits=DIGITS 2 の代わりに指定された数字を使う -s, --quiet, --silent 出力ファイルの大きさを表示しない -z, --elide-empty-files 空の出力ファイルを削除 --help この使い方を表示して終了 --version バージョン情報を表示して終了 ファイルが - ならば標準入力を読み込みます. 各々のパターンは: 行数 指定行の直前まで(その行は含まれない)を書き込む /正規表現/[オフセット] 一致する行の直前までを書き込む %%正規表現%%[オフセット] 一致する行の直前までをスキップ {整数値} 直前のパターンを指定した数だけ繰り返す {*} 直前のパターンを可能なだけ繰り返す オフセットの指定には `+' または `-' に正の整数値を続けて指定します.
SUBSTRING_INDEX(str,delim,count)
mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2); -> 'www.mysql' mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2); -> 'mysql.com'
Returns the substring from string str before count occurrences of the delimiter delim. If count is positive, everything to the left of the final delimiter (counting from the left) is returned. If count is negative, everything to the right of the final delimiter (counting from the right) is returned. SUBSTRING_INDEX() performs a case-sensitive match when searching for delim. mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2); -> 'www.mysql' mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2); -> 'mysql.com' This function is multibyte safe.
<?php $values = array( 0, 1, 1237, '1237', '1234', null, '', ' ', ' ', '-', 'a', '*', 'あ', ); foreach($values as $v) { echo number_format($v), "\n"; //echo "raw :'", $v, "'\n"; //echo "double:", number_format((double) $v, 5), "\n"; //echo "float :", number_format((float) $v, 5), "\n"; //echo "int :", number_format((int) $v, 5), "\n"; }
0 1 1,237 1,237 0 0 0 0 0 0 0 0 0
0 1 1,237 1,237 PHP Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 0 PHP Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 PHP Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 PHP Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 PHP Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 PHP Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 PHP Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 PHP Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21 Warning: number_format() expects parameter 1 to be double, string given in /home/hato/work/sandbox/php/number_format.php on line 21