I need HELP Writing text to a FILE
I am looking for help on writing to a text file:
Lets say i have a file name text.text and i want to echo out "enter name"
then echo "enter age". The collected information i would like to append it to a file that is created when the function is called:
function addText() {
name=$1
age=$2
folder="$HOME/dir/"
fileName=${folder}dir${age}.txt
tempFile=${folder}films${name}Temp.txt
echo "$name" >> $fileName
}
input:
Enter Name: Raymond
Enter Age: 20
next input:
enter name: ray
enter age: 22
the Output inside the file should look like:
"Raymond", "20"
"ray", "22"
... etc
|