- 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 06:38 AM
тАО10-31-2007 06:38 AM
how to implement script command in a .cshrc ( csh)
i encounter error when try to implemented a script command in a .cshrc file.
the line i added in .cshrc is :
set tstamp=(`date +%d%m%Y-%H%M%S`)
set fscript=/sgx/core/tslog/log-$tstamp
script $fscript
#echo $tstamp
Is the way doing is wrong for .cshrc ? any help is appreaciate. i canot figure what went wrong.
attached the 1st part of the .cshrc contents and the next part separated by line is the error shown when i login as the particular user .cshrc profile
- Tags:
- csh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 06:46 AM
тАО10-31-2007 06:46 AM
Re: how to implement script command in a .cshrc ( csh)
setenv tstamp `date +%d%m%Y-%H%M%S`
setenv fscript /sgx/core/tslog/log-$tstamp
script $fscript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 06:54 AM
тАО10-31-2007 06:54 AM
Re: how to implement script command in a .cshrc ( csh)
Did you just log into the system as a regular user when the output was generated? I'm not sure why you get the multiple iterations of the script command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 07:09 AM
тАО10-31-2007 07:09 AM
Re: how to implement script command in a .cshrc ( csh)
csh was used because legacy, then can the user variable assigned using the setenv?
I as a root user, then i do su - user and run the .cshrc and get the script command running repeately. i am wonder why ? also some error
Warning: ridiculously long PATH truncated
any idea ?
i try your method it still don't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 07:15 AM
тАО10-31-2007 07:15 AM
Re: how to implement script command in a .cshrc ( csh)
PATH keeps getting added to, no logins get finished, and so on.
Still not sure why you'd want to use csh. I'm not sure what you mean by "Its legacy"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 07:21 AM
тАО10-31-2007 07:21 AM
Re: how to implement script command in a .cshrc ( csh)
note that if you do something like this in the other shells, the command immediately after the "script" command needs to be "exit", otherwise the user will remain logged in after they type exit the first time (and logging to the file will be shut off)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 07:38 AM
тАО10-31-2007 07:38 AM
Re: how to implement script command in a .cshrc ( csh)
the script in .cshrc is seems working, but i noted a strange behaviour. When the 3 new added line executed, the alias ( shortcut ) in .cshrc missing when i do a su - user .
later when i type exit command it come back to the csh prompt with alias take effect ?
How to explain on this ? strange.
any advise is appreaciate.
bin is a shorcut to a path /sgx/core/bin
for e.g
$ pwd
/sgx/login/coreadm/RUN
$ bin
sh: bin: Execute permission denied.
$ exit
Script done, file is /sgx/core/tslog/log-01112007-033355
[~/RUN ](21)
[~/RUN ](21) bin
[/sgx/core/bin ](22)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 07:53 AM
тАО10-31-2007 07:53 AM
Re: how to implement script command in a .cshrc ( csh)
-i Force csh to respond interactively when called from a device other than a computer terminal (such as another computer). csh normally responds non-interactively. If csh is called from a computer terminal, it always responds interactively, regardless of which options are selected.
note the part about "runs interactively". this implies that the .cshrc will always be run, so you are basically recursing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 07:55 AM
тАО10-31-2007 07:55 AM
Re: how to implement script command in a .cshrc ( csh)
strange problem is when i su - username run the .cshrc ,
it say :
Script started, file is /sgx/core/tslog/log-01112007-035155
$
normally when user login it should show this type of prompt.
[~/RUN ](21)
BUT the csh prompt suppose to show is gone, and only when i type exit it return back and all alias is back to effect, how to overcome this problem. i try to put a exit after the script command , it show same symptom.
any advise is appreaciate. for e.g
bin is a shorcut to a path /sgx/core/bin
$ pwd
/sgx/login/coreadm/RUN
$ bin
sh: bin: Execute permission denied.
$ exit
Script done, file is /sgx/core/tslog/log-01112007-033355
[~/RUN ](21)
[~/RUN ](21) bin
[/sgx/core/bin ](22)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2007 08:03 AM
тАО10-31-2007 08:03 AM
Re: how to implement script command in a .cshrc ( csh)
A) I wouldn't / don't expect this to ever work as you want in csh.
B) It will work as desired if you change the users shell to either sh (POSIX) or sh
C) If you do B, then but "exit" after script in the users ".profile"