Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Working with lines or variables that have spaces or special characters

$
0
0
Example:
Code:

while read line
do
stat -c %G $line
done < somefile.txt

The problem is that inside somefile.txt lines can have any symbol allowed as file name, like (). Even with spaces, it splits the words.


somefile.txt:
Code:

dira/my first jump.avi
dirb/surf video (1080p).mkv


Viewing all articles
Browse latest Browse all 16232

Trending Articles