Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getnum(){
- ls "$1" | grep "$2$"
- }
- getnum() {
- ls "$1" | grep "$s$" | cut -d_ -f 2
- }
- getnum() {
- ls "$1" | grep "$s$" | cut -d_ -f 2 | sort -n
- }
- getnum() {
- ls "$1" | grep "$s$" | cut -d_ -f 2 | sort -n | head -1
- }
- getnum() {
- local oldnum=$(ls "$1" | grep "$s$" | cut -d_ -f 2 | sort -n | head -1)
- }
- getnum() {
- local oldnum=$(ls "$1" | grep "$s$" | cut -d_ -f 2 | sort -n | head -1)
- if [ "$oldnum" = "" ]
- then
- oldnum=0
- fi
- printf "%02dn" $(($oldnum+1))
- }
- dir=somewhere/logs
- ext=testfile.json
- cp template $dir/$(date +%Y%m%d_)$(getnum "$dir" "$ext")_$USER_$ext
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement