"Shell returned" message on Linux


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers "Shell returned" message on Linux
# 1  
Old 01-08-2010
Question "Shell returned" message on Linux

Hi,
I am compiling following code on my Linux box using "cc" compilers.I am getting the desired o/p but in the it throws message as "shell returned 208".I would like to know whether is it related to a some kind of error code?

Code:
     1 #include<stdio.h>
      2
      3 main ()
      4 {
      5 char x = 65;
      6 int i;
      7 for (i=1;i<=26;i++)
      8 {
      9 printf("%c\n",x++);
     10 }
     11 }

Thanks
# 2  
Old 01-08-2010
No it is not an error.

You have to 'return 0' as the last statement of your program. You have missed to do, so by default the last statements return value will be returned to the shell which is actually 2 here.

That is returned by print to the program ( print returns the number of characters printed. ).

Got IT ?

Explicitly specify 0, then you will get that ZERO as returned.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix "look" Command "File too large" Error Message

I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this: $ look "string" "/home/patrick/filename.txt" However, this gives me the following message: "look: /home/patrick/filename.txt: File too large" So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies

2. Programming

error "Invalid argument" returned after call sched_setscheduler

the code is below and the was run on Solaris 9. ----------------------------- struct sched_param param; param.sched_priority = 99; if(sched_setscheduler(0, SCHED_RR, &param) == -1) { perror("setting priority"); exit(1); } ------------------------------- after the... (1 Reply)
Discussion started by: robin.zhu
1 Replies
Login or Register to Ask a Question