In the Korn shell is it possible to truncate a pattern like this: -
[[ $name == @(backup[\.][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]) ]]
So that it is not necessary to enter
[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]
8 times?
In the Korn shell is it possible to truncate a pattern like this: -
[[ $name == @(backup[\.][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]) ]]
So that it is not necessary to enter
[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]
8 times?
Hi.
[[ $name = @(backup.{8}([0-9])).* ]] && echo yes
yes
Assuming you are using ksh93 and not pdksh or ksh88
name=backup.12345678
echo $name
[[ $name == backup.{8}(\d) ]] && echo "yes"