How to call shell script into perl?

Unix: What is the best way to get script (typescript) to work with a restricted shell?

  • I have a scenario where I want to log every activity for a particular  user. I have a script built around the script command which I invoke  from the user's .profile. Now the requirement is that the user should  not be able to delete the subsequent typescript file that is created.  Towards that, I've created a user with the default shell of rksh and put  a restriction on commands that can wipe the file out. But the problem  is that when I login with that user, if I call the script with the  script command, the forked shell is always sh and not rksh. I know that  if SHELL is not set, then the forked shell will be /bin/sh by default,  but I have SHELL setup properly. How do I ensure that the forked shell  is rksh only? If I comment out the call to the logger from .profile, then I get a  rksh shell. But even then if I manually issue the script command, it  launches sh.

  • Answer:

    I guess you need to set default shell for your user as rksh. You can do this while adding a user using -s option which is for setting a default shell for that user.

Vishwajit Paste at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.