- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to implement script command in a .cshrc ( ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 08:04 AM
тАО10-31-2007 08:04 AM
Re: how to implement script command in a .cshrc ( csh)
So there is no remedy for this issue ?
cause the .cshrc is run without user input. am i right ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 08:22 AM
тАО10-31-2007 08:22 AM
Re: how to implement script command in a .cshrc ( csh)
I haven't used this shell in ~10 years, so I'm not real sure. This should get you close.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 02:52 PM
тАО10-31-2007 02:52 PM
Re: how to implement script command in a .cshrc ( csh)
This seems correct. If you insist on using the scummy C shell you need to know what each file does. .login is similar to .profile and .cshrc is similar to .kshrc (or whatever is in ENV).
I assume Avalanche wants to log the user's commands on login, not for every shell invocation.
>Patrick: Why anyone would willingly use the C shell is a mystery to me.
Exactly.
setenv tstamp `date +%d%m%Y-%H%M%S`
setenv fscript /sgx/core/tslog/log-$tstamp
Why would you suggest exporting those local variables? The only reasonable use is to stop the recursion by checking if tstamp exists. (You didn't suggest that.)
- Tags:
- scummy C shell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 03:22 PM
тАО10-31-2007 03:22 PM
Re: how to implement script command in a .cshrc ( csh)
I had try to put the 3 lines in the .login of the user home directory, but result the same , it run the script command, the .cshrc export alias is back to normal when i type exit from the script. it basically same as what i describe early.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 03:33 PM
тАО10-31-2007 03:33 PM
Re: how to implement script command in a .cshrc ( csh)
What .cshrc export alias? You modified .login and you shouldn't have changed anything else.
And you will have to type "exit" twice. Once to exit script(1) and once to exit your scummy C shell. I suppose you can prevent that by using "exec script $fscript".
>it basically same as what i describe early.
You shouldn't have the recursion. Or PATH being too long.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 03:38 PM
тАО10-31-2007 03:38 PM
Re: how to implement script command in a .cshrc ( csh)
Is there any way to overcome this problem? i want to achieve to logged the user login session into a file by doing the script command in csh , but it seems to be problem.
Had try to insert the script line in .login but it doesn't work, the .cshrc alias setting is lost when in invoke the script command, only when exit, the .cshrc alias setting is return normal, and once again i type exit to logout frm the session.
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 03:47 PM
тАО10-31-2007 03:47 PM
Re: how to implement script command in a .cshrc ( csh)
Ah, simple solution, source .cshrc in .login.
>once again i type exit to logout from the session.
Simple solution exec script(1) as I mentioned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 04:06 PM
тАО10-31-2007 04:06 PM
Re: how to implement script command in a .cshrc ( csh)
>What .cshrc export alias? You modified .login and you shouldn't have changed anything else.
---> .cshrc export the alias of shortcuts to directory, like
alias bin "cd /abc/df/bin"
alias run "cd /abc/login/bh/RUN"
So you mean i only need to put the 3 line in .login or .cshrc ? i try put in .login it doesn;t work, the script kept recursively output the filename with diff timestamp.
>And you will have to type "exit" twice. Once to exit script(1) and once to exit your scummy C shell. I suppose you can prevent that by using "exec script $fscript".
--> so it mean i insert the line "exec script $fscript" in .login or .cshrc file.
>it basically same as what i describe early.
You shouldn't have the recursion. Or PATH being too long.
-----> when i put the 3 line in .cshrc it output the following in attached text file, same error :
Warning: ridiculously long PATH truncated
then cause many file with diff timestamp created, so i need to exit many time to get out from the shell prompt...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 04:26 PM
тАО10-31-2007 04:26 PM
Re: how to implement script command in a .cshrc ( csh)
i put the line source /sgx/login/super1/.cshrc in .login file, then put the line "exec script $fscript" in .cshrc file.
But it output the same undesired result.
Any advise ?
a file atached with .login follow by .cshrc and a output of the action when i su - user as root and when it run the .cshrc once login.
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 04:42 PM
тАО10-31-2007 04:42 PM
Re: how to implement script command in a .cshrc ( csh)
Don't touch the .cshrc file. That's no end of problems.
Only change the end of .login to source the .cshrc file, followed by the the set commands, then at the end:
exec script $fscript