Is it recommended to use shell's :
null command on supposedly portable scripts? Does it cope with csh, zsh, tcsh and whatever shell it may exist around there?
In general, shell aspects that relate to syntax and built in features should be "portable" as long as the script is always executed by the same shell (and version of the shell, to some degree), even if that shell happens to be the fish shell.
The shell is the Linux command line interpreter. It provides an interface between the user and the kernel and executes programs called commands. For example, if a user enters ls then the shell executes the ls command.
BASH or Perl is not always in the same location (PATH) such as /bin/bash or /usr/bin/perl. If you want to make sure that script is portable across different UNIX like operating systems you need to use /usr/bin/env command as shebang.
A command-line interface (CLI) is an operating system shell that uses alphanumeric characters typed on a keyboard to provide instructions and data to the operating system, interactively.
A shell command is one that is processed internally by the shell. There is no corresponding executable program. Take cd for instance. There is no /bin/cd program, say, and which cd specifies that it is a built-in command. It is part of the shell.
So yes, the shell and the terminal emulator are completely separate programs, and either can be used without the other.
Yes. It's the standard null utility. Reference: http://pubs.opengroup.org/onlinepubs/000095399/utilities/colon.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With