what is the cmd to display the last exit status in UNIX?

Answer Posted / arjun

$? it will give the status of the previous command
it will give 0(zero) last command is successful else it will
give any non-zero character.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it inbetween or in between?

587


What is the function of grep command in unix?

591


What is the comma to display different lines that are found when compare two files?

595


Why is awk called awk?

581


hw will u use awk in replacing cahrs and files

2736






Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?

644


What is the difference between awk and grep?

561


What is the use of sed command in unix?

601


What does the “echo” command do?

624


What does the metacharacter mean?

612


Why is it called a shebang?

574


When i run a programm of orphan process. Instead of getting child's parent (ppid)=1 ..i get 1400 and it varies as per system. How can i findthe right soluion??? My pgm: #include # include int main() { int pid; pid=fork(); if(pid < 0) {exit(-1);} else if(pid==0) { printf("Child Process is Sleeping ..."); sleep(10); printf("Orphan Child's Parent ID : %u ",getppid()); } else { printf("Parent Process Completed ... %u ",getpid()); exit(0); } return 0; } Output:

1764


What is unix command?

584


What does 'mkdir' command do in UNIX?

660


How do I search for text in vi?

588