0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

scriptをより便利に使うためコマンド

Last updated at Posted at 2018-11-23

作った理由

普段、scriptを使用して、作業ログをとるとき、いちいちフォルダを指定したり、
ファイル名を指定するのって面倒だな〜...よし作るかという感じで作ってます

GitHub

https://github.com/prune2525/log_script/blob/master/log_script
# コード

# 日付取得
mm=`date +'%Y%m%d'`
cd $HOME/
if [ -d $mm ]; then
  :
else
    # 日付ディレクトリ作成
  mkdir $mm
fi
cd $mm
# 日時取得
dt=`date +'%Y%m%d%H%M%S'`
# ファイル名作成
file_name="scriptlog_$dt.log"
# 実行部
script ./$file_name
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?