On Thu, 22 Sep 2005, frantisek holop wrote: > hi there, > > i have found the following interesting case. > is this the intended behaviour? > > kripel> jot -s"" -b - 72 > 72-b73-b74-b75-b76-b77-b78-b79-b80-b81-b82-b83-b84-b85-b86-b87-b88-b89-b90-b91-b92-b93-b94-b95-b96-b97-b98-b99-b100-b101-b102-b103-b104-b105-b106-b107-b108-b109-b110-b111-b112-b113-b114-b115-b116-b117-b118-b119-b120-b121-b122-b123-b124-b125-b126-b127-b128-b129-b130-b131-b132-b133-b134-b135-b136-b137-b138-b139-b140-b141-b142-b143-b144-b145-b146-b147-b148-b149-b150-b151-b152-b153-b154-b155-b156-b157-b158-b159-b160-b161-b162-b163-b164-b165-b166-b167-b168-b169-b170-b171 > > kripel> jot -s "" -b - 72 > ------------------------------------------------------------------------
Yes, this is expected. The following program shows how the args are passed in each case: [EMAIL PROTECTED]:94]$ cat x.c #include <stdio.h> int main(int argc, char *argv[]) { int i; for (i = 0; i < argc; i++) printf("%d = \"%s\"\n", i, argv[i]); } [EMAIL PROTECTED]:95]$ ./a.out -s"" -b - 72 0 = "./a.out" 1 = "-s" 2 = "-b" 3 = "-" 4 = "72" [EMAIL PROTECTED]:96]$ ./a.out -s "" -b - 72 0 = "./a.out" 1 = "-s" 2 = "" 3 = "-b" 4 = "-" 5 = "72" [EMAIL PROTECTED]:97]$ In the first case, the shell concatenates -s and "" into a single arg, and the -b gets interpreted as the separator etc. -Otto