Stack Overflow archive
1 scoreaccepted

readlink unable to take path names mentioned in a file

score
1
question views
237
license
CC BY-SA 3.0

Change

bash
readlink -f $line > a.txt

to

bash
readlink -f "$line" >> a.txt

The >> appends to a file or creates the file if it doesn't exist.

The > overwrites the file if it exists or creates it if it doesn't exist.

https://serverfault.com/a/196735

Originally posted on Stack Overflow. Public user contributions are licensed under Creative Commons Attribution-ShareAlike.