LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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



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 09:32 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
Open Source Consulting | Domain Registration