nick34992
2/20/2017 - 3:05 AM

Bash: echo, exec, cat: File Descriptor for Appending

Bash: echo, exec, cat: File Descriptor for Appending

#!/bin/bash

echo 'first line' > input.txt # new file
exec 5>>input.txt
echo 'appended line' >&5      # append line
cat input.txt