linux - How do I add a new username and password to a database list (i have a pass file an a username file -
!/bin/bash
i working on school linux class. trying make script log username , send "users2". password go "passwords2".
echo -n "username:" read | user2 echo -n "password:" read | password2
i have tried can think of if can me love that. thank you, zack
to redirect output screen file, can use >
, or >>
append, example
echo "some text" > file.txt echo "some other text" >> file.txt
will result in
$ cat file.txt text other text
to store user input variable, input
, use read input
.
other that, missing semicolon between 2 commands echo ...
, read
(or put them on separate lines).
a minimal example script, appends user input file:
#!/bin/bash echo -n "input: "; read input echo $input >> file.txt
Comments
Post a Comment