![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cron - Not working properly | risshanth | HP-UX | 23 | 10-31-2007 03:34 AM |
| Telnet is not working properly | deepak_pathania | UNIX for Dummies Questions & Answers | 1 | 10-05-2007 02:59 PM |
| Rlogin not working properly from Linux | frankkahle | UNIX for Advanced & Expert Users | 1 | 10-19-2006 07:02 PM |
| Keyboard not working properly... | timresh | UNIX for Dummies Questions & Answers | 2 | 02-25-2005 04:28 AM |
| pf not working properly even with only "pass in all" and "pass out all" rules | xyyz | UNIX for Advanced & Expert Users | 4 | 12-30-2003 02:33 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
y is this not working properly?
#include <stdio.h>
#include <sys/types.h> #include <string.h> #include <sys/stat.h> #include <unistd.h> struct stat s; main() { char c[100]; if (fork()==0) { system("clear"); do { printf("myAI\\>§ "); scanf("%s",c); if(stat(c,&s)>-1) { system("att"); } else if (strcmp("machine",c)<0) { system("echo $USER@`hostname`"); system("echo kernel : `uname -r`"); system("kde-config --version | grep KDE"); } } while (strcmp("exit",c)); exit(1); } wait(NULL); } |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
What are you trying to do with
Code:
strcmp("machine",c)<0
|
|
#3
|
|||
|
|||
|
it didnt change big deal
|
|
#4
|
|||
|
|||
|
there's the answer
(strcmp("machine",c)==0) im trying to make my own shell, i thk its the best way for me to grasp C and Bash at the same time |
|||
| Google The UNIX and Linux Forums |