is there a way to execute shell scripts inside your C program?
Type: Posts; User: elsheepo
is there a way to execute shell scripts inside your C program?
? could you please explain?
okay, so here is the same program, only having it output all commands onto one script file.
#include<stdio.h>
#include<string.h>
void strip_newline(char *str,int size)
{
int i;
...
Here's what's going on. I wrote this program, and I would like it to write all the commands to one shell script, and execute each command in order, because the first command needs to finish before...
I'm curious if anyone here has any idea how to write a 'shell script' that will open multiple shells and execute commands within each shell.
And then if so, how to make your C program that...
beatzz@hax0r:~/documents/c/test$ man fopen
No manual entry for fopen
beatzz@hax0r:~/documents/c/test$
Of course this program is only to help further the efforts of security on my own private, HOME network. :D
Here is what I have so far.
#include<stdio.h>
#include<string.h>
void strip_newline(char *str,int size)
{
int i;
for(i=0;i<size;++i){
if(str[i]=='\n'){
str[i]='\0';
Fixed it all! Thanks a bunch!
Your answer guided me to the correct code!
Okay, I fixed the pointer issues, but what did you mean about striping the \n newlines? I don't have any \n newlines
Hey, so I've been writing this new program to help me run aircrack-ng a little faster. Here is what I have thus far.
#include <stdio.h>
int main()
{
char bssid[20];
char essid[20];
int...
indeed, I am a very basic programming thus far. But thanks for your help it really helps :)
I supose that this may be getting more into the principles of programming, but what do you mean a function returns an object?
1. Dose that mean when declaring a function such as "main()" I should write it "int main()"?
2. Is "free()" only used in conjunction with"malloc(sizeof())"?
3. Can someone please explain these...
so is it a good idea to have
return 0; in all functions?
okay, I got the program to work the way I wanted it to at least. I'm not sure if I fully understand pointers at the moment, but I supose with time I will. Thanks for the help guys
#include...
I understand what anon is saying, just leave the malloc out, and it would work fine, but I'm trying to use it just for the tutorials sake.
#include <stdio.h>
#include <stdlib.h>
main()
{
int...
so how dose one appropriately use free(); ?
Hello, once again :) today is devoted to the pointers lesson! Now I have compiled everything successfully on the lesson so far except for the function
free(ptr);
here is what I have so far that...
Do you mean I should have
return 0; in each function as good practice?
made it a little more effiecent
#include <stdio.h>
main()
{
int a;
printf("1.FOR loop\n2.WHILE loop\n3.DO-WHILE loop\nSelect a loop to preform:");
scanf("%d",&a);
switch(a){
case 1:
...
lol that was supposed to be the reply to what I thought was the thread I had posted this morning which was actually just the preview of the thread I was intending on posting.
Well after a few hours with it this morning I have fixed all the bugs and answered my own questions, here is the corrected code if anyone wants to see it.
#include <stdio.h>
main()
{
int a;
...
Those are the first things on my "to do" list once i learn how to program!!! :D
lol indeed. I figured I should have taken that out when I edited it, I don't meant to offend any Windows coders :x much <3 for the ease and....well, I got much <3 for the ease of windows ;)