Anonymous user
Append a record to the end of a text file: Difference between revisions
Append a record to the end of a text file (view source)
Revision as of 21:12, 15 October 2020
, 3 years ago→{{header|Nim}}
m (→{{header|Nim}}) |
m (→{{header|Nim}}) |
||
Line 2,157:
for rec in records:
echo str(rec)
# Add a new record at the end of password file.
Line 2,171 ⟶ 2,170:
echo "---------------------"
echo str(newRecord)
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:
|