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

When and how linux developed?

0 Answers  


What are some popular Linux distributions?

1 Answers  


Did you work with linux? What flavors and versions?

5 Answers   HP,


Which Command used to lock user password in Linux?

0 Answers  


Which commands are used to set a processor-intensive job to use less cpu time?

0 Answers  


What are the basic dos commands?

0 Answers  


How do I know my shell?

0 Answers  


What is the command to check cpu speed in linux?

0 Answers  


What is the best cpu stress test?

0 Answers  


How many linux commands are there?

0 Answers  


What is cpu utilization linux?

0 Answers  


when i create SAMBA server it is ok but while i try for access from windows pc he ask me only first time smb password then i close samba login next time he can`t ask for passwd why.?

4 Answers   Wipro,


Categories