0

I have this file named checkinout100.php and need to copy it to another 100 files following the numbered sequence like checkinout101.php, checkinout102.php and so on until 200.
I've been looking to do it with seq but can't figure it out on my own.
Thanks.
NOTE: Has nothing to do with webpages. It's an Asterisk PBX (Yeastar), I need one of those files per extension (link with hotel software).

Filipe YaBa Polido
  • 1,656
  • 1
  • 17
  • 39
  • 2
    I can only imagine the atrocity you are about to create with these 100 php files. I think you're missing the point. – Jonathon Reinhart Apr 08 '15 at 10:41
  • why on earth would you want to do this? - the more proper solution here would be to use a get or post method to set the number; checkinout.php?number=101 – Henrik Apr 08 '15 at 10:42
  • @JonathonReinhart don't ask, lol. It's an Asterisk device connected with hotel software, it really need's those files, one for each extension. – Filipe YaBa Polido Apr 08 '15 at 10:44
  • Either you're missing something or that is the most asinine software ever created. – Jonathon Reinhart Apr 08 '15 at 10:45
  • 1
    ok.. if not a wep page, you couild probably have used commandline arguments, but... hey... http://php.net/manual/en/reserved.variables.argv.php – Henrik Apr 08 '15 at 10:46
  • 1
    @Henrik, I understand. However, this is a PBX system that links with hotel software. It's a requirement of that software, so my hands are tied and just had to create the files :) – Filipe YaBa Polido Apr 08 '15 at 11:11

1 Answers1

3

You can use seq in the following way:

for n in $(seq 101 200) ; do
    cp checkinout100.php checkinout$n.php
done
choroba
  • 231,213
  • 25
  • 204
  • 289