日常开发中的shell小技巧

工具推荐

  • 命令行中很方便的代码统计工具---cloc

模拟生成熵(避免暴力手搓键盘)

sudo rngd -r /dev/urandom  -o /dev/random  -f   

自动输密码的脚本,基于expect

#!/usr/bin/expect
set password "butub"
set files [glob -nocomplain -- ./*.deb]
puts "[llength $files]"
for {set i 0} {$i<[llength $files]} {incr i 1} {
    set fileName [lindex $files $i]
    spawn sudo dpkg-sig --sign builder $fileName
    expect "*Enter passphrase:*"
    send "$password\n"
    puts "$fileName"
}
#interact

git提交时不用输入密码的方法

git config --global credential.helper store

猜你喜欢

转载自www.cnblogs.com/bingduoduo/p/10920081.html