cancel
Showing results for 
Search instead for 
Did you mean: 

Running a OS command- in Receiver Comm Channel in PI

Former Member
0 Kudos

I want to Run an OS command below to concatenate the files in Receiver Communication Channel under " Run OPerating System Command After Message Processing" :

/usr/bin/cat XXX/XX/*.txt > XXX/XX/op.txt

The channels runs successfully and it does not fail or give warning . All it gives is Information : Execute OS command "/usr/bin/cat XXX/XX/*.txt > XXX/XX/op.txt". Still the *.txt files kept does not get concatenated.

Can anyone please suggest how to do the concatenation using OS command or let me know the correction required above

Accepted Solutions (0)

Answers (4)

Answers (4)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Pankaj,

                  you are using correct command it seems. Just try modifying the command to this form

cat /usr/mydir/*.txt> /usr/mydir/op.txt 2>/usr/mydir/error.txt

I am using absolute path while describing the path name. Each path starts from root ("/").

Secondly if there is any error in script it is written down to a file  /usr/mydir/error.txt . After execution of script is complete please check contents of the file  /usr/mydir/error.txt, you will find reason of error.

Hope this resolves your problem.

All the best.

Regards

Anupam

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Just few cents... Check whether script user credentials has priviledge to access these two files.  That could be a problem.

Former Member
0 Kudos

Hi Pankaj,

As Raja, said try to test the script alone and then try to use in your communication channel.

But, I think there would be an issue, if you are using the same folder and with the same extension of the file.

rajasekhar_reddy14
Active Contributor
0 Kudos

it looks the way you calling script is not a right approach, run your script stand alone and see the fucntionality, if it is working then it should work when you cann from PI also.