Hello all! I am fairly new to linux. I am using fedora7 bash. I am using an awk statement to extract several fields from a file and assign them to variables within awk. With some fields in that file and some variables made within awk i would like to use useradd and set specifications for the account. Via the command line i can successfully add the user by manually adding in information however i would like to use the information from the text file. I need to know what is the syntax for using useradd within awk. So far, my code looks like this
system("useradd -G " var1 " -g " var2 " -m -s "$1" -u "$2" -K PASS_MIN_LEN=4 -K PASS_MAX_LEN=7 -p "*" "usrname")
i know this syntax is off but i just dont know how to use it within awk. Please help