Whats the difference between $status and $?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Whats the difference between $status and $?
# 1  
Old 01-04-2010
Question Whats the difference between $status and $?

Hi,

In linux we have exit status variable ($?) and status which tells whether last command was successfull or not. Can someone please tell me what is difference between both. Both tells whether command was successful or not, Any particular difference between them?

Thanks in Advance.

Thanks
Sarbjit
# 2  
Old 01-04-2010
The only one I know of is that not all shells support both of them:
Code:
$ uname -sr
SunOS 5.8
$ ksh -c 'print $status'

$ csh -c 'echo $?'
Variable syntax

# 3  
Old 01-04-2010
$? is from sh/ksh/bash
$status is from csh family
both means the exit status of the last command
# 4  
Old 01-04-2010
Just to add that the recent versions of the (t)csh family (and zsh) support both.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

How to track table status delete/update/insert status in DB2 V10 z/os?

Dear Team I am using DB2 v10 z/os database . Need expert guidance to figure out best way to track table activities ( Ex Delete, Insert,Update ) Scenario We have a table which is critical and many developer/testing team access on daily basis . We had instance where some deleted... (1 Reply)
Discussion started by: Perlbaby
1 Replies

2. Programming

what is the main difference between difference between using nonatomic lseek and O_APPEND

I think both write at the end of the file ...... but is there a sharp difference between those 2 instruction ..... thank you this is my 3rd question today forgive me :D (1 Reply)
Discussion started by: fwrlfo
1 Replies

3. Programming

mmap and malloc, whats the difference?

In what situations one would use malloc instead of mmap and vice versa. Both return a virtual addr ptr. So whats the difference? (4 Replies)
Discussion started by: dragonpoint
4 Replies

4. UNIX for Dummies Questions & Answers

whats the difference between zombie orpha and defunct processes

can some one please explain zombie orphan defunct and how they r related (3 Replies)
Discussion started by: pbsrinivas
3 Replies

5. Shell Programming and Scripting

whats the difference between $* and $@

Hi, whats the difference between $* and $@ in command line arguments to a shell scripts (3 Replies)
Discussion started by: pbsrinivas
3 Replies

6. Red Hat

Installing RedHat 8.0 onto Dell PowerEdge SC1425 - hdc: status error: status = 0x58

I have successfully installed RedHat 8.0 onto a Dell PowerEdge SC1425 today. This server has two SATA hard drives, and an IDE DVD-ROM drive. Using the following kernel parameters, i successfully installed across both hard drives from CD: ide0=0x1f0,0x3f6,14 vga=791 resolution=1024x768 expert... (5 Replies)
Discussion started by: fishsponge
5 Replies

7. Shell Programming and Scripting

check the status and send an email with status

Hi, We have a text file which has the following data. ISA~00~ ~00~ ~ZZ~VISTN ~ZZ~U1CAD ~051227~183 7~U~00200~000011258~0~P~< GS~FA~EE05J~U1CAD~051227~1831~000011258~X~002002 ST~997~0001 AK1~SH~247 AK2~856~2470001 AK5~A AK2~856~2470002 AK5~A... (3 Replies)
Discussion started by: isingh786
3 Replies

8. UNIX for Dummies Questions & Answers

Linux OR Unix Whats The Difference!

What is the difference bettween linux and unix? Sorry but I am really new to this! :confused: Also are they BOTH free :-D (1 Reply)
Discussion started by: jamesthemagicia
1 Replies

9. UNIX for Dummies Questions & Answers

Whats the difference between...

the various distros of free Linux and other *nix OSes? I'm curious. (1 Reply)
Discussion started by: hype.it
1 Replies

10. UNIX for Dummies Questions & Answers

Couldn't open status file /var/samba/STATUS.LCK

I believe i have most of samba configured right but i get this error each time time try to run it. I was given suggestion that i touch the file, i did, but i still cannot rid myself of this error. Any suggestions (2 Replies)
Discussion started by: macdonto
2 Replies
Login or Register to Ask a Question