简体   繁体   English

回显不打印到文件

[英]echo not printing to file

i have a large list of telephone numbers I need to delete from a database, Im adding the telephone numbers to a single file on newlines and using the following script to generate the SQL insert command for me to manually paste.我有大量电话号码需要从数据库中删除,我将电话号码添加到换行符的单个文件中,并使用以下脚本生成 SQL 插入命令供我手动粘贴。

file="Input.txt"
while IFS= read line
do
echo "delete from usr_preferences where uuid like '$line';"; >> output.txt
done <"$file"

Input file data -输入文件数据 -

1111111111
2222222222
3333333333
4444444444

It's working as expected other than it prints in the terminal rather than printing to file output.txt它按预期工作,除了在终端中打印而不是打印到文件 output.txt

What have I missed?我错过了什么?

Thanks谢谢

Thanks to Andrey B. Panfilov and markp-fuso感谢 Andrey B. Panfilov 和 markp-fuso

Removing;删除; before the output command worked.在 output 命令起作用之前。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM