mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-28 22:05:03 +00:00
31 lines
423 B
Bash
Executable File
31 lines
423 B
Bash
Executable File
#!/bin/zsh
|
|
|
|
if [ "$1" = "" ]; then
|
|
echo 'Name?'
|
|
exit 1
|
|
fi
|
|
|
|
name="${1%.rb}"
|
|
max_num=$(ls | grep test- | sort -r | head -n 1 | cut -c 6-8)
|
|
let next_num=$max_num+1
|
|
|
|
new_file="test-${next_num}${name}.rb"
|
|
|
|
cat > "$new_file" <<EOF
|
|
#!/usr/bin/ruby -w
|
|
|
|
class T_${next_num}${name} < Test
|
|
def description
|
|
"INSERT DESCRIPTION"
|
|
end
|
|
|
|
def run
|
|
# INSERT COMMANDS
|
|
hash_tmp
|
|
end
|
|
end
|
|
|
|
EOF
|
|
|
|
echo "New file is $new_file"
|