Iam running a system command and need to pass both error and success to same log file. Here system command is in a loop with different commands,. I tried as above but still not working.
test.pl
system("ls test.pl>output" ), this will write the result to a file output.However if the command fails it throws the error on the screen. How can we redirect the error to a file. I need to redirect both success & failure log in a file
[Linux ~]$ perl test.pl
ls: est.pl: No such file or directory
[Linux~]$
I need to delete the line before tool error. I can read the file line by line and match for the key word " tool error", but not sure how to delete the line before the matched line.
Any pointers to solve this?, thnaks in advance
I have a file with below contents. the file is dynamically created with these values.It has two parts separated by _. Basically I need to create a main directory(a,b,c ,d) first part and create the sub subdirectory(se cond part after _) into the respective directory. can you please give few tips to do the same.
I need to take the count of txt and bak files present in all the directory.for eg if we assume there are two directoies say(test1, test2), I need to collect the count(of txt and bak files) and print it out..
I tried the below code, but could not achieve what I need.Can someone help me on the same.
Leave a comment: