Sorry if the title is a little bit confusing but basically im trying to make a command that will change the default shell of a user.
The user just needs to call the command (btb) and input the username e.g. btb USERNAME
btb being args[0] and USERNAME being args[1]. Now i need to make this into one string so that i can use it to make a system call system("chsh -s /bin/bash USERNAME")
.
So far i have this
int Registerbtb(char **args)
{
char command[50];
strcpy(command, args[1]);
system(command);
return 1;
}
which is only taking the args[1] and putting that into command. But i need it to do is strcpy(command, ("chsh -s /bin/bash %s", args[1]));
but that isnt possible.
What other way can i do this so that command will have the string "chsh -s /bin/bash USERNAME"
in it