Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * do_bgfg - Execute the builtin bg and fg commands
- */
- void do_bgfg(char **argv)
- {
- int pid;
- /* determine whether argv[1] is a jid or a pid */
- printf("jid or pid: %s \n", argv[1]);
- if(strncmp(argv[1], "%", 1) == 0)
- {
- printf("found- this is a jid\n");
- char key[] = "1234567890";
- char * pch;
- pch = strpbrk (argv[1], key);
- int i = atoi(pch);
- printf("%i\n", i);
- pch = strpbrk (pch+1,key);
- }
- else
- {
- printf("this is a pid. \n");
- pid = atoi(argv[1]);
- }
- return;
- }
Add Comment
Please, Sign In to add comment