Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のコマンドを実行するこのシェルスクリプトがあります。
#!/bin/sh echo -e " {\"username\":\"user\",\"password\":\"mypasswd\",\"data\"" > $file
実行時間を測定し、実行時間とスクリプト出力の両方をファイルにエコーするために、これをどのように調整する必要がありますか?
任意のヒント?
コマンドを使用しtimeます。例えば:
time
time ( echo -e "$(date) \n--\n{\"username\":\"user\",\"password\":\"mypasswd\",\"data\": [$formated]}\n --" ) > $outputFileName 2>&1