There are many commands that accept multiple parameters, like touch, ls and rm. So that I can use the construct {1..3} to generate multiple parameters for the command. For example:
[root@192 ~]# touch file{1..3}
[root@192 ~]# ls file{1..3}
file1 file2 file3
[root@192 ~]# rm -f file{1..3}
[root@192 ~]#
Some commands don't support multiple parameters, like groupadd. So the following command generates an error:
[root@192 ~]# groupadd g{1..3}
Usage: groupadd [options] GROUP
...
[root@192 ~]#
Is it possible to generate multiple complete commands like groupadd g1; groupadd g2; groupadd g3;? I tried the following command, but failed:
[root@192 ~]# `"groupadd g"{1..3}`
bash: groupadd g1: command not found...
[root@192 ~]#
Btw, I'm a Bash new user and the example is just for demo purposes. I'm not trying to create a bunch of groups.