Use of Colon in Shell script

Use of Colon in Shell script

  • Sometimes it is useful to have a command which does “nothing”.
  • The : (colon) command in Unix does nothing

#!/bin/sh
if grep unix myfile
then
:
else
echo “Sorry, unix was not found”
fi

shell programming use of colon
shell programming use of colon
For any query or issue, feel free to discuss on http://discuss.eduguru.in