.. apart from not using LVM + ext4?RageMatrix wrote:What am I doing wrong here?
D&RFC...

.. apart from not using LVM + ext4?RageMatrix wrote:What am I doing wrong here?

Okay, I'll biteDungeon-Dave wrote:.. apart from not using LVM + ext4?RageMatrix wrote:What am I doing wrong here?
D&RFC...



Code: Select all
/home/directory/my documents/my file.txt
Code: Select all
/home/directory/my\ documents/my\ file.txt
Code: Select all
for filename in $(cat ~/file.txt | sed -e 's/ /\\/g')
do
echo "$filename"
done
Code: Select all
/home/directory/my\documents/my\file.txt
Code: Select all
for filename in $(cat ~/file.txt | sed -e 's/ /\\ /g')
do
echo "$filename"
done
Code: Select all
/home/directory/my\
documents/my\
file.txt
I'm not sure that it's sed to blame.RageMatrix wrote:Gah - does sed do something special with whitespace in regexs?
It's not a newline character, but it is the default bash "field separator". Your bit of sed outputs a series of strings with spaces in, so I think the for loop is looping over each part of the string - much like doing "for i in a b c d".RageMatrix wrote:What the hell? Since when did a space become a newline character?
Code: Select all
(IFS=; for filename in $(cat ~/file.txt | sed 's/ /\ /g'); do echo $filename; done)Code: Select all
(IFS=; for filename in $(sed 's/ /\ /g' ~/file.txt); do echo $filename; done)
Code: Select all
OFS="$IFS"
IFS=","
while read COL1 COL2 COL3
do
IFS="$OFS"
# do something with my data
IFS=","
done
IFS="$OFS"
Code: Select all
sed -e 's/ /\\ /g' < file.txt |
while read FILENAME
do
echo "$FILENAME"
done



Code: Select all
find . -maxdepth 1 -name "* *" > acd
while read line; do echo mv "$line" ${line// /_}; done < acd