From d32ebd109ba62e7621eca65366f350999a43cc28 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 14 Nov 2013 22:55:04 +0900 Subject: [PATCH] add func randomstr --- bashrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bashrc b/bashrc index 5aabacf..062403f 100755 --- a/bashrc +++ b/bashrc @@ -364,6 +364,12 @@ null type gitmemo && alias m=gitmemo alias setup.py="sudo python3 setup.py install --record files.txt" +randomstr(){ + len=$1 + test -z "$len" && len=8 + uuidgen | tr -d - | cut -c 1-$len +} + datestr(){ # datestr yyyyMMdd-hhmmss if test -z "$1" || test "$1" == "-h"