Alguien que use /bin/sh

1998-09-10 Por tema Octavio Rodriguez Perez
Hola! ¿Como compruebo el numero de parametros de la linea de comandos en el /bin/sh? Me explico: #!/bin/sh if (num_args_entrada != 2) then hacer_algo else hacer_otra_cosa fi Saludos a todos, Octavio

Re: Alguien que use /bin/sh

1998-09-10 Por tema Sergio Gomez Bachiller
On Thu, 10 Sep 1998, Octavio Rodriguez Perez wrote: #!/bin/sh if (num_args_entrada != 2) then hacer_algo else hacer_otra_cosa fi Mu facil, con $#, que devuelve el numero de parámetros. De esta forma tu ejemplo quedaria: #!/bin/sh if (test $# -ne 2) then echo No