I know this isn't Perl related, but I am quite stumped. I am trying to edit the .profile of a user so that all they can run is a single program at login, and if they try to use Ctrl-C or Ctrl-Z to exit, the system would ignore it, and when they do exit the program properly, they would be logged off the system. Right now, if they log off properly, they get a command prompt (they also get a prompt if they do a Ctrl-C or Ctrl-Z).
if [ "$TERM"="" ]then
eval `tset -s -Q -m':?hp'`
else
eval `tset -s -Q`
fi
stty erase "^H" kill "^U" intr"^C" eof "^D"
stty hupcl ixon ixoff
tabs
PATH=$PATH:.
set -u
trap "echo 'logout'" 0
set -o ignoreeof
EDITOR=vi
export EDITOR
## Here are the lines that I am adding.
cd /home/production/scripts
USER=`who am i|cut -c 1..8`
(trap "trap 0;exit" 0 1 3 15; cobrun /home/production/cobol/obj/eftchg
+ $USER)
The system in question is an HP-UX mainframe system, and the user's shell is ksh by default. If there are any monks out there who have a good understanding of shell scripting, any help or ideas would be greatly appreciated. Thank you.
RedDog
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.