I have over-complicated this problem with if/then scripts and super simple one line commands but for some reason I keep getting stumped.
I am trying to create a new directory a-e
and place the files a,b,c,d,e
inside of it. For some reason it will create the directory just fine but places the files inside of the ps
directory instead of the new directory.
#!/bin/bash
mkdir /home/adminuser/ps/a-e && touch /home/adminuser/ps/a-e {a..e}
touch /home/adminuser/ps/a-e {a..e}
will do two things: 1) Update the modification/access/change time of the already existing directory/home/adminuser/ps/a-e
and 2) create five filesa, b, c, d and e
in your current working directory ...ps
happened to be your current working directory and that is why ...touch
takes arguments separated by spaces and therefore your passed arguments are actually 6 and not 5 as you expected./
instead of a space there:touch /home/adminuser/ps/a-e/{a..e}