- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: reading and displaying log using csh
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
тАО03-27-2005 06:32 PM
тАО03-27-2005 06:32 PM
reading and displaying log using csh
I used to read lines from a LOGfile using ksh "
#!/usr/bin/ksh
while read line
do
echo "$line"
done < $LOGFILE
but when try using csh, it gives me error "
while: expression syntax".. does this means it doesnt work for csh?.. is there an alternative script I can use to produce the same thing?
regards
Henry
- Tags:
- csh
- while loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2005 07:03 PM
тАО03-27-2005 07:03 PM
Re: reading and displaying log using csh
another and, as far as I remember, syntax for "while"
loop in csh is different than that in ksh. (I don't think
there is a "do" after "while" in csh). You should
really take a look at csh(1) manpage.
- Biswajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2005 11:46 AM
тАО03-28-2005 11:46 AM
Re: reading and displaying log using csh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2005 12:25 PM
тАО03-28-2005 12:25 PM
Re: reading and displaying log using csh
there (as last time I used csh was atleast 10
years back :-).
But I fail to understand why are you trying to write
this in csh. "ksh" and "sh" are probably the most
popular shells in unix right now and I personally
would not spend any time learning csh. But, ofcourse,
you might have your compelling reason for this. In
that case, someone else in this forum should be
able to help you.
- Biswajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2005 01:19 PM
тАО03-28-2005 01:19 PM
Re: reading and displaying log using csh
I have no time to check correct systax for U.
But you can read shell userguide at
http://docs.hp.com/en/B2355-90046/index.html
HTH
tienna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2005 01:47 PM
тАО03-28-2005 01:47 PM
Re: reading and displaying log using csh
Now the question: why use a very limited and incompatible shell when your csh users can run the exact same script? The first line (#!/usr/bin/ksh) tells the csh shell to use a different interpreter. This is why a csh, ksh or any other Unix shell user can run a perl script or any other interpreter without changing the current shell. As long as your scripts start with #!/usr/bin.... then you can write your scripts in any shell language that's available on your system.
This link may be helpful: http://www.maths.leeds.ac.uk/~read/csh.html
Note that references to the Bourne shell should be replaced with "POSIX shells including ksh, HP-UX sh, bash, etc)
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2005 02:26 PM
тАО03-28-2005 02:26 PM
Re: reading and displaying log using csh
thanks!
Henry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2005 04:25 PM
тАО03-28-2005 04:25 PM
Re: reading and displaying log using csh
Just say NO! :-).
Yeah I know, easy for me to say, but seriously, for your own sanity please try to get 'them' to articulate why csh is required.
My other 'shoot from the hip' reaction would be: for lexical work like trouncing through a log, use a lexxial tool like AWK or PERL.
>> .. Apparently there really isnt much info on csh anywhere...
For good reason... :-).
Good luck,
Hein.
- Tags:
- scummy C shell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2005 04:35 PM
тАО03-28-2005 04:35 PM
Re: reading and displaying log using csh
What can I say..
Well the reason being that I am not able to decipher the following in csh..
"alias CMD1 /usr/bin/cmd1
set planpath = "/users/home1/plan_path"
set tkind = 0x103
alias START 'onintr -; CMD1 path $planpath \!*; CMD1 start \!* $tkind;onintr TEXIT; CMD1 init'
TEXIT:
"
Can it be translated to ksh, if so how??
this is really alien to me..
thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2005 09:35 PM
тАО03-29-2005 09:35 PM
Re: reading and displaying log using csh
#!/bin/csh
foreach line (`cat
echo $line
end