Search Results

Search: Posts Made By: dhanda2601
9,470
Posted By Corona688
You should not use scanf to read lines, scanf has...
You should not use scanf to read lines, scanf has a list of problems that are too long to get into. (sscanf is safer.)

char buf[512];

fgets(buf, 512, stdin); // Read a line
if(strchr(buf,...
9,470
Posted By itkamaraj
try this.. not tested char str[10]; ...
try this.. not tested


char str[10];
char cmd[20];
printf("Enter the string : ");
scanf("%s",str);
sprintf(cmd,"whereis %s",str);
system(cmd);
9,470
Posted By RudiC
Pls use code tags as advised. You did not read...
Pls use code tags as advised.
You did not read what I wrote. Put everything into a new variable and supply that (I think by reference) to the system call.
9,470
Posted By RudiC
You should allocate a char variable, fill it with...
You should allocate a char variable, fill it with the string constant "whereis " (e.g. sprintf) and the contents of your user input variable (e.g. strcpy), and supply that to the system call.
Forum: Programming 01-24-2013
4,062
Posted By milestails
I really appreciate you help me! I don’t...
I really appreciate you help me!

I don’t have much real knowledge of this kind of stuff, nor know the technical terms. Most of what I know is just from messing around, one of these days I should...
13,761
Posted By Corona688
Ah, so you want to touch directory contents. You...
Ah, so you want to touch directory contents. You don't need a seperate command, though, just put two together, one to find files, one to touch them. find path/to/directory -exec touch '{}' ';'...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 09:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy