LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-01-2016, 08:36 AM   #1
mikenash
Member
 
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
cepheus11
Member
 
Registered: Nov 2010
Location: Germany
Distribution: Gentoo
Posts: 282

Rep: Reputation: 88
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
mikenash
Member
 
Registered: Dec 2014
Posts: 84

Original Poster
Rep: Reputation: Disabled
Thank You.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:57 PM.

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