gareth0402
gareth0402

Reputation: 103

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

Upvotes: 0

Views: 751

Answers (1)

gareth0402
gareth0402

Reputation: 103

Thanks to Andrey B. Panfilov and markp-fuso

Removing ; before the output command worked.

Upvotes: 1

Related Questions