Append a record to the end of a text file: Difference between revisions
Content deleted Content added
Line 2,157: | Line 2,157: | ||
for rec in records: |
for rec in records: |
||
echo str(rec) |
echo str(rec) |
||
echo "" |
|||
# Add a new record at the end of password file. |
# Add a new record at the end of password file. |
||
Line 2,171: | Line 2,170: | ||
echo "---------------------" |
echo "---------------------" |
||
echo str(newRecord) |
echo str(newRecord) |
||
echo "" |
|||
if pwfile.getLock(): |
if pwfile.getLock(): |
||
pwFile.writeLine(newRecord) |
pwFile.writeLine(newRecord) |
||
Line 2,209: | Line 2,207: | ||
directory: /home/jdoe |
directory: /home/jdoe |
||
shell: /bin/bash |
shell: /bin/bash |
||
Appending new record: |
Appending new record: |
||
Line 2,220: | Line 2,217: | ||
directory: /home/xyz |
directory: /home/xyz |
||
shell: /bin/bash |
shell: /bin/bash |
||
Raw content of updated password file: |
Raw content of updated password file: |