Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a unix command that will always return nothing no matter what parameters are given to it?

Tags:

shell

unix

I want to put it at the top of a unix executable. right after the #!

I know it seems silly, but I would like suggestions.

like image 799
700 Software Avatar asked Dec 02 '22 04:12

700 Software


2 Answers

Most systems have a /usr/bin/false

NAME
     false -- Return false value.

SYNOPSIS
     false

DESCRIPTION
     The false utility always exits with a nonzero exit code.

SEE ALSO
     csh(1), sh(1), true(1)

STANDARDS
     The false utility conforms to IEEE Std 1003.2-1992 (``POSIX.2'').
like image 165
Quentin Avatar answered Dec 25 '22 20:12

Quentin


Sounds like a job for the "colon" built-in

   : [arguments]
         No  effect;  the command does nothing beyond expanding arguments
         and performing any specified redirections.  A zero exit code  is
         returned.
like image 26
glenn jackman Avatar answered Dec 25 '22 21:12

glenn jackman