LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-11-2007, 11:03 PM   #1
muradcsc
LQ Newbie
 
Registered: Dec 2007
Posts: 14

Rep: Reputation: 0
mount return code


mount returns code for example 0 fro success, 32 mount failure.
How to retrieve the return codes (for example into a file)??

Any help will be appreciated.

muradcsc
 
Old 12-12-2007, 01:46 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,844

Rep: Reputation: 1596Reputation: 1596Reputation: 1596Reputation: 1596Reputation: 1596Reputation: 1596Reputation: 1596Reputation: 1596Reputation: 1596Reputation: 1596Reputation: 1596
Running
Code:
man mount
you'll get:
Quote:
RETURN CODES
mount has the following return codes (the bits can be ORed):

0 success

1 incorrect invocation or permissions

2 system error (out of memory, cannot fork, no more loop devices)

4 internal mount bug or missing nfs support in mount

8 user interrupt

16 problems writing or locking /etc/mtab

32 mount failure

64 some mount succeeded
 
Old 12-12-2007, 04:29 AM   #3
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
you can pipe the output of mount to a text file.
 
Old 12-12-2007, 04:55 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Quote:
Originally Posted by muradcsc View Post
How to retrieve the return codes (for example into a file)??
The shell variable $? stores the return code of the previous command. You can easily treat this variable as any other in shell scripts.
 
Old 12-13-2007, 03:05 AM   #5
muradcsc
LQ Newbie
 
Registered: Dec 2007
Posts: 14

Original Poster
Rep: Reputation: 0
thanx I have got it
 
  


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
return code or errno? micropanther Programming 2 10-29-2007 09:23 AM
Return code while writing to procfs e-razor Programming 6 10-05-2007 02:08 PM
request_region(...) return code BrooklynOutlier Programming 0 03-07-2006 09:22 PM
request_region return code BrooklynOutlier Slackware 0 03-06-2006 10:26 PM
dd return code barefootdoctor Linux - General 2 10-13-2005 12:54 PM

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

All times are GMT -5. The time now is 02:10 AM.

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