Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-18-2002, 06:40 AM   #1
Registered: Feb 2002
Posts: 48

Rep: Reputation: 15
Question ash script (please)

I know i know... why ash and not bash...
I have my reasons.

Can anyone tell me how to do a simple equate like...

if ./dosfsck == 1 then
echo Blah blah


case ./dosfsck in
0) Uhhm...
1) DoThis
2) DoThat

The only thing i've been able to do is a boolean check...

if ./dosfsck then

How can I check the return value more exact?????
Old 04-18-2002, 09:38 AM   #2
Senior Member
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
$? contains the return value of the last command which is run. That's the way bash does it and I just tested it in ash and it seems to work too.



case $? in
0) echo 'zero';;
1) echo 'one';;
2) echo 'two';;


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
CJK support in ash shell uiqbal Linux - General 0 10-18-2005 08:24 AM
SATA on Adaptec ASH-1205sa KJ Jantzen Linux - Hardware 1 06-13-2005 01:37 PM
Use bash as an alternative to ash? J_Szucs Linux - General 3 05-30-2005 04:44 AM
Sarge - only ASH in shell no BASH jriis Debian 1 12-25-2003 03:25 PM
Can ash recall previous commands? Scerj Linux - General 0 06-06-2001 02:18 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:57 AM.

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