Use built-in zsh functionality instead of subprocesses

This commit is contained in:
Moritz Bunkus 2012-01-05 20:07:21 +01:00
parent 90dd8f2afa
commit c1ec721ea8

View File

@ -6,8 +6,8 @@ if [ "$1" = "" ]; then
fi
name="${1%.rb}"
max_num=$(ls | grep test- | sort -r | head -n 1 | cut -c 6-8)
let next_num=$max_num+1
max_num=(test*(.On[1]))
let next_num=${max_num[1][6,8]}+1
new_file="test-${next_num}${name}.rb"