Hello, I need help making my shell in c. The shell needs to ignore spaces, this means that you can put the spaces you want an the command needs to work, I already resolved that problem, the next problem is that if you put ; two commands need to be recognized for example "ls ; ps", I need help in that problem P.D : I need to use execvp and fork [CODE] #include <stdlib.h> #include <string.h> #include <stdio.h> #include <unistd.h> #include <sys/types.h> int main(void) { int pid; int i,j,k; char s[200]; char command[20][10]; char **order; char *orderptr[20]; int m; int …

Member Avatar
Member Avatar
+0 forum 1

Hello there, I have an issue with execvp to a project in C i'm trying to procces.. Execvp is always returning -1.. and this warning " passing argument 2 of ‘execvp’ from incompatible pointer type" .. here's the source code, and any advice at the matter would be appreciated! [CODE]#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/shm.h> #include <sys/stat.h> #include <string.h> int main(int argc, char *argv[]) { FILE *fp1; FILE *fp2; char txtline[1000]; int rows1,columns1,rows2,columns2,i,j; int pid; fp1=fopen("pinakas1.txt","r+"); fscanf(fp1,"%d %d",&rows1,&columns1); int segment_idA = shmget(IPC_PRIVATE, rows1*columns1*(sizeof (int)), S_IRUSR | S_IWUSR); int *shared_memoryA=(int*) shmat (segment_idA , NULL, 0); for(i=0;i<rows1;i++) { for(j=0;j<columns1;j++) { …

Member Avatar
Member Avatar
+0 forum 2

Hi everyone! Does anyone here know how to create a C program that will open a web browser depending on the user input? For example if the user inputs the integer 1, the web browser will be opened and will go to 'http://www.daniweb.com', when the input is 2, 'http://www.google.com' will be opened, and so on. The websites that will be opened will be pre-determined, meaning it will be set in the program source code that everytime the input is 1 the web browser will go to 'http://www.daniweb.com' only; no random choosing of websites will be done. Replies and/or links to …

Member Avatar
Member Avatar
+0 forum 12

The End.