I m 试图撰写一个双面文字,处理一个文件清单,其名字在投入档案中每栏一栏储存,就像一个一样。
find . -type f -mtime +15 > /tmp/filelist.txt
for F in $(cat /tmp/filelist.txt) ; do
...
done;
我的问题是档案中的名称。 轮胎可能含有空间,因此,上述氮化物将扩大线。
my text file.txt
<编码>my,text
and file.txt
。 我如何确定这一点?
I m 试图撰写一个双面文字,处理一个文件清单,其名字在投入档案中每栏一栏储存,就像一个一样。
find . -type f -mtime +15 > /tmp/filelist.txt
for F in $(cat /tmp/filelist.txt) ; do
...
done;
我的问题是档案中的名称。 轮胎可能含有空间,因此,上述氮化物将扩大线。
my text file.txt
<编码>my,text
and file.txt
。 我如何确定这一点?
使用<条码>条码>
while read F ; do
echo $F
done </tmp/filelist.txt
或者利用国际助老会改变你名单的空壳:
OLDIFS=$IFS
IFS="
"
for F in $(cat /tmp/filelist.txt) ; do
echo $F
done
IFS=$OLDIFS
或者(根据@tangens的建议),将贵方的体体转化为单独的文字,然后使用<代码>find。 s 如果直接发现每个档案,可选择操作。
如果没有使用替代程序的临时档案,你可以这样做:
while read F
do
...
done < <(find . -type f -mtime +15)
改为
cat $FILE | while read line
do
echo $line
done
您可以转而使用管道,而不是铺设管道。
您可直接使用<代码>-exec para amount of find
,并直接使用文档名称:
find . -type f -mtime +15 -exec <your command here> {} ;
<代码>{>为文档名称的持有人。
您认为直线直线直线直线,而后再看 lo。
find . -type f -mtime +15 | while read -r line
do
printf "do something with $line
"
done
我不是一位神职专家,不管怎样(我通常在废墟或大 p中写我的文字,以便相互交错),但我会利用一种礼让,在你处理之前从每一行走空间。
For Bash Regex: http://www.linuxjournal.com/node/1006996
在鲁比拉的类似情况下(处理一件小事,在使用之前清理每一行):
File.foreach(csv_file_name) do |line|
clean_line = line.gsub(/( )/, )
#this finds the space in your file name and escapes it
#do more stuff here
end
我认为,你可以完全和直接地绕过寻找结果,即:
for F in $(find . -type f -mtime +15) ; do
...
done;
我没有保证我的辛迪加是正确的,但我很相信这一概念是可行的。
Edit:如果你真的必须处理档案并填写档案名称清单,而且能够像我前面那样简单地把指挥合并起来,那么你就可以改变“
I just asked a question about whether it was possible to write a web-page-checking code and run it from free web server, and one supporter answered and said that it was possible only if I run "a web ...
I am sorry if my question is silly and not at the right place. I know it s possible to write a script (in any programming language) that would check some webpage every 20 minutes, record its HTML ...
Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...
I like to write bash shell scripts on my iPhone, put them in an app folder with an icon, plist, etc., so they execute like apps by tapping their icon on SpringBoard. This is not interactive like ...
I am construcing a command in bash dynamically. This works fine: COMMAND="java myclass" ${COMMAND} Now I want to dynamically construct a command that redirectes the output: LOG=">> myfile.log ...
When I execute a Scala script from the command line, a directory named "tmp" is created in my home directory. It is always empty, so I simply deleted it without any apparent problem. Of course, when I ...
I have a project that uses ant to build and ivy for dependencies. I would like to generate the start scripts for my project, with the classpath, based on the dependencies configured in Ivy, ...
I m 试图撰写一个双面文字,处理一个文件清单,其名字在投入档案中每栏一栏储存,就像一个一样。