If your file is not too large and all the files are well-named (without spaces or other special characters, such as quotation marks), you can simply:
chmod 755 $(<file.txt)
If you have special characters and / or many lines in file.txt .
xargs -0 chmod 755 < <(tr \\n \\0 <file.txt)
if your command should be executed exactly 1 time by record:
xargs -0 -n 1 chmod 755 < <(tr \\n \\0 <file.txt)
This is not necessary for this example, since chmod accepts multiple files as an argument, but this matches the question header.
In some cases, you can locate the file argument in commands generated with xargs :
xargs -0 -I '{}' -n 1 myWrapper -arg1 -file='{}' wrapCmd < <(tr \\n \\0 <file.txt)
F. Hauri Dec 18 2018-12-12T00: 00Z
source share