アウトプットができる技術者に

it's a time to take a new step !

2014-02-23から1日間の記事一覧

Bash シェルスクリプトで標準入力を受け取る

cat - で 標準入力を受け取り、利用できる。 #!/bin/sh if [ -p /dev/stdin ] ; then echo "stdin" cat - else echo "nothing stdin" fi 変数の格納する例 #!/bin/sh if [ -p /dev/stdin ] ; then a=$(cat -) echo "input string is ${a}" else echo "nothin…

find mtime の挙動

24時間以内に修正されたファイル find ./ -mtime -1 -type f 48時間以内に修正されたファイル find ./ -mtime -2 -type f 24時間以上 経過したファイル *以上の場合は0から開始になることに注意 find ./ -mtime +0 -type f 24~48時間の間に修正されたファイ…

JavaのPropertyを全て出力する

import java.util.Properties; import java.util.Set; public class AllProp { public static void main(String[] args){ Properties list = System.getProperties(); Set<String> s = list.stringPropertyNames(); for(String key : s){ System.out.println(key +"=</string>…