Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How do display error messages instantly when command fails?

Answers were Sorted based on User's Feedback



How do display error messages instantly when command fails?..

Answer / rallapalli

HE did not ask how to redirect error of a command. He said
clearly. How do you display error message instantly when
command fails.

ans:
By default it will display no need to do any thing. when u
type wrong command the error will display on screen.
Ex:
#usradd tom
ERR: command not found

ok?

Is This Answer Correct ?    7 Yes 0 No

How do display error messages instantly when command fails?..

Answer / ajit mohan b

Suppose you are trying to cat a non existing file:

cat /etc/shado 2>/dev/null || echo “Failed to open file”

command 2 "echo" is executed only if command 1 "cat" returns
a non-zero exit status

# cat /etc/shado 2>/dev/null || echo "Failed to open file"
Failed to open file
#

Is This Answer Correct ?    6 Yes 2 No

Post New Answer

More Linux Commands Interview Questions

What are two functions the move mv command can carry out?

0 Answers  


What is 9 in kill?

0 Answers  


What is pwd in linux command?

0 Answers  


Explain about gzip filename?

0 Answers  


You need to see the last fifteen lines of the files dog, cat and horse. What command should you use?

0 Answers  


I lost a root password and i need to give it, I treid to change it through single usermode even though i am not get a password, then what is the other procedure to give a root password?

8 Answers  


How to check load balance using linux command?

1 Answers   Rakuten,


What is grep command?

0 Answers  


What are runlevels in linux?

0 Answers  


What is build process?

0 Answers  


which command is used to see all the system configuration? like hardware, HDD, memory etc.

14 Answers   ADS, eClinicalWorks, NJN,


why do u want to join this company

6 Answers   HCL, Infosys, United Healthcare, Wipro,


Categories