简体   繁体   中英

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.

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

What have I missed?

Thanks

Thanks to Andrey B. Panfilov and markp-fuso

Removing; before the output command worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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