Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-01-2016, 08:36 AM   #1
Registered: Dec 2014
Posts: 84

Rep: Reputation: Disabled
What does the || true do in the mesg command do?

mesg n || true
Found this mseg command in a .profile that causes an error when logging into the user on lightvm. I would like to know what
mesg n || true is doing. I understand that the mesg n is a do not disturb but I do not understand the || true part.
What does the || true do in the mesg command do?
Old 04-01-2016, 09:50 AM   #2
Registered: Nov 2010
Location: Germany
Distribution: Gentoo
Posts: 286

Rep: Reputation: 91
It forces the whole expression to exit with a success status: The operator "||" means the command to the right is only executed if the command beforehand exited with a "failure status" (exit code != 0). The "true" command does nothing but exit with exit code 0 which means "success".

Last edited by cepheus11; 04-01-2016 at 09:52 AM.
Old 04-01-2016, 10:14 AM   #3
Registered: Dec 2014
Posts: 84

Original Poster
Rep: Reputation: Disabled
Thank You.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LFS 7.7 : bash: mesg: command not found TIBO Linux From Scratch 10 05-21-2015 06:16 AM
find command return true if a file was found catalint Programming 12 05-19-2011 06:52 AM
[SOLVED] Display True file size using ls -l command in CentOS dmchenry Linux - Newbie 3 04-20-2011 07:47 AM
True Command Line...arrrgh help hitman_et Linux - Newbie 7 10-31-2004 06:10 AM
finger command shows never logged on...but its not true falconxlc Linux - General 4 12-09-2002 10:26 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration