I thought there was a file like /etc/profile for per-interactive-shell startup.
Using /etc/profile for type of work has the drawback, that this file is not sourced always, but only if the bash is invoked as login-shell, and the --noprofile option is not used.

Which is what the OP asked.
Not sure of this. The OP said f somebody uses the copy command in bash, which is different from saying if somebody uses the command 'cp' from the command line. For example, the user might invoke a shell script, which contains a command to copy the file (maybe cp, maybe a different one), and this would then not necessarily be monitored.

Honestly, I don't know the deeper purpose for the OP's request. If he just want to spare his users the task to explicitly run his Perl scripts after each copying process, he could simply provide a script for doing copying+inspecting, and ask the users to run his script instead of using the original cp commmand. Of course, any user is then free to put an alias to this script in his or her .bashrc, and this would work in a similar way for ksh or zsh too.

On the other hand, if the OP wants to enforce this type of check, because he suspects that the users, on purpose, might not use his script, all alternatives discussed here are very easy to bypass.
-- 
Ronald Fischer <ynnor@mm.st>

In reply to Re^4: How to let perl knows if somebody copies a file by rovf
in thread How to let perl knows if somebody copies a file by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.