0

I'm doing a little versioning system in shell for school. The teacher tell us to use seq but I didn' t find how to use it. I've:

patch $2 .version/$2.{`seq -s"," 2 $3`}

where $2 is the file I need to patch, .version/$2. are the patch I need to apply, from 2 ($2.2) to the argument specified ($2.$3). It return:

patch: **** Can't open patch file .version/test.sh.{2,3} : No such file or directory

So it seems the seq is good, but patch didn't interpret it. test.sh.2 and test.sh.3 exist.

Is there a way to do it like this or am I in the wrong direction?

Sorry for the english, it's not my native language.

marc3825
  • 3
  • 3

1 Answers1

0

According to its manual page, patch expects one patch-file at a time. You might redo your example like this:

for n in `seq 2 $3` ; do patch $2 .version/$2.$n; done

The reason for the -s option is unclear, so I removed it as well.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • The -s"," was to use , as a separator between the number, to get a working array, like when you do something like touch .version/{1,2,3}. But with your version there isn't any need for this. Thanks for your reply, I will work in this way. – marc3825 Mar 22 '15 at 20:08