I've got a script that scp's a file from remote host back to local. Sometimes the file names contain spaces. scp does not like spaces in its file names.
I have the following script - its supposed to loop files names using find but it seams to break the files names up by a space? I need the file names to remain intact
#!/bin/bash
for file in `find -name "*.avi"`
do
echo $file
done
Can anyone help me?
Thanks
how can i make find/sed to include directory names with spaces
the command is like this
Code:
for i in `find wp-content/themes -type f -print0 | xargs -0 grep -l
-iE 'e'`;do sed -i -e 's/word1/word2/gI' "$i";done
but it skips one directory names with spaces
Code:
sed: can't read ./Nova: No such file or directory
sed: can't read pasta/font/bougan_black_ssi_bold-webfont
Hi,
I have a directory with the following file names
Code:
01 - abc hyn
02-def
03-ghi[www.Unix3333.com].dir
04 - jhu[www.Unix.com].dir
abc1 kil
def bil
The last two file names abc1 starts with one space and def starts with double space. I want these files in my directory to be renamed as
Code:
ABC HYN
DEF
GHI.dir
JHU.dir
ABC1 KIL
DEF BIL
Thanks
I have several (427 to be precise) text files with a million lines each containing 31 numbers separated be spaces (possible double spaces). However there might be some data corruption and there may be lines containing junk.
I now want to check if every line satisfies the property of containing 31 items separated by spaces (I assume that those items are numbers.
If I do
cd /run/media/len/My\ Book/Windows\ backup
I get put in the right directory.
However if i do
BACK="/run/media/len/My\ Book/Windows\ backup"
echo $BACK
gives me the exact same sequence
but
cd $BACK
gives me
bash: cd: /run/media/len/My\: No such file or directory
I've tried various different ways of writing it, but I can't get it to work.
The spaces in the names were created long
Hello,
I have a script that "validates" a ZIP file that look like this
Code:
AAA_20120801.zip =>
x~back end~20120801.TXT
y~time in~20120801.TXT
z~heat_chamber~20120801.TXT
AAA_20120801.ctl
My task is to compare its contents (i.e the list of files contained inside) with the control file that is provided inside the ZIP file itself.
Since we've started receiving files with spa
Hi,
I wish to create empty .txt files from a list of 150 file names that I have listed in Libre Calc.
I understand that one technique for dealing with spaces in filenames is to enclose the file name with single quotes: "'".
Why is it that the following code called, "echo.sh" works on a directory containing filenames with spaces, but the program "ls.sh" does Not work, where the only difference is 'echo' replaced with 'ls'?
echo.sh
#!/bin/sh
for f in *
do
echo "'$f'"
done
Produces:
'a b c'