Append a record to the end of a text file: Difference between revisions

m
Line 2,157:
for rec in records:
echo str(rec)
echo ""
 
# Add a new record at the end of password file.
Line 2,171 ⟶ 2,170:
echo "---------------------"
echo str(newRecord)
echo ""
if pwfile.getLock():
pwFile.writeLine(newRecord)
Line 2,209 ⟶ 2,207:
directory: /home/jdoe
shell: /bin/bash
 
 
Appending new record:
Line 2,220 ⟶ 2,217:
directory: /home/xyz
shell: /bin/bash
 
 
Raw content of updated password file:
Anonymous user