
Originally Posted by
hakermania
Hi all! I hope I am posting to the right section...
I am currently working on a program in C...
What I want to do is not only to call a system's .sh file, but edit the .sh file in a way that the user have the opportunity after running it to set his on variables.
For example:
In my C program in a point I say:
if (a==1) {system ("/home/alex/scripts/prog/macchanger2.sh"); system("/home/alex/Qt/hak/hak);}
Well, the problem is that the macchanger2.sh is something like this:
echo "Type your new mac address:"
echo
macchanger -m yy:yy:yy:yy:yy:yy wlan0
How can I tell the script to let the user type his preferable mac address and put it where yy:yy:yy:yy:yy:yy is?
I hope I were understandable enough....If not, plz let me know....
I guess it would be easier to just ask a string to the user (the mac address) and use system(macchanger -m blabla...) instead of calling the script.
But to answer your question:
Code:
echo "Type your new mac address:"
read mac_address
macchanger -m $mac_address wlan0