Results 1 to 3 of 3

Thread: Help with script files!!!

  1. #1
    Junior Member
    Join Date
    Jan 2010
    Posts
    33

    Default Help with script files!!!

    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....
    LoooL

  2. #2
    My life is this forum Snayler's Avatar
    Join Date
    Jan 2010
    Posts
    1,418

    Default

    Quote Originally Posted by hakermania View Post
    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

  3. #3
    Junior Member
    Join Date
    Jan 2010
    Posts
    33

    Default

    Quote Originally Posted by Snayler View Post
    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
    Ok thx!!!!!!!!!!!!!!!!!!!!!!
    LoooL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •