Score:0

how we can append the data in perl using bash?

us flag

i have multiple perl scripts ,currently its working from the shell, but my requirement is like automate this scripts from the bash.

perl smtp-check.pl < unmatched-00250 > good_smtp_251 2> bad_smtp_251 

from the above line unmatched-00250 is my arg().good_smtp_251,bad_smtp_251 these files are output files.

i have multiple files like unmatched-00250 ,currently iam going each folder and running this script.

i don't know how to we can append the perl file in the loop.

Please Can any one help me out on this.

hr flag
The only perl argument here is the name of the script (`smtp-check.pl`) - all the redirections are handled by the shell. You can write a shell loop to iterate over directories and run a command in each one - there's nothing special about the fact that the command happens to involve perl.
Vamshi Krishna CH avatar
us flag
actually i did that but the only problem here how we can append the data ,because i have bunch of files. in above perl cmnd how we can assign this , i tried below cmd but its not working ,please help me perl smtp-check.pl < unmatched-00250 >>good_smtp_251 2>> bad_smtp_251
Vamshi Krishna CH avatar
us flag
for i in `find /root/SMTP-Check/20210603/temp/*` ; do perl /root/SMTP-Check/smtp-check.pl <$i> /tmp/GT_IPS_new 2>> /tmp/bT_IPS_new ; done this one is working but its in overwrite mode, need append mode
hr flag
Please [edit] this information into your question, instead of posting it in comments
cn flag
Changing `>` to `>>` is what you should do. You say that's "not working". Exactly how is it not working? What does it actually do, and how is that different from what you expect? The Stackoverflow [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) is a good guide.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.