GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script question
Operating System - HP-UX
1847252
Members
3406
Online
110263
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
04-08-2004 06:13 AM
04-08-2004 06:13 AM
My manager wanted me to modify our 'prt' script so that information from all the reports that are printed goes to a 'record' file. That seems to be working fine but sometimes we get some reports that have headers that are much longer and have caused us problems.
I tried to make a change to the script to keep any file headers of a certian length are ignored. With that change none of the header information is going into the 'record' file. Any ideas as to what I am doing wrong?
I am attaching the script and I also highlighted the part that I am having problems with.
Thanks for the help.
I tried to make a change to the script to keep any file headers of a certian length are ignored. With that change none of the header information is going into the 'record' file. Any ideas as to what I am doing wrong?
I am attaching the script and I also highlighted the part that I am having problems with.
Thanks for the help.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2004 07:00 AM
04-08-2004 07:00 AM
Solution
Hi Jeff,
you commented out 3 lines (around the rm -rf /tmpspool/.$$)? Is that the change you made?
I see 2 other things:
1)
if [ "$12" = '' ]
then
echo `date +%D-%X` $1 $2 $3 $4 $5 $6 $7 $8 >> /tmpspool/record
fi
$12? Is there a $12 in the call to your script? Do a short test by creating a script that prints $12 and ${12}!
$12 equals $1 followed by the digit 2 I'm afraid. So indeed it's never equal to '' and nothing gets logged.
2) There is a chmod command all alone on a line, without arguments.
In ksh you can also define a variable with a fixed length (typeset -L40: left justified, leading blanks removed, 40 chars, padded on the right with blanks if necessary). Maybe that's of any help.
JP
you commented out 3 lines (around the rm -rf /tmpspool/.$$)? Is that the change you made?
I see 2 other things:
1)
if [ "$12" = '' ]
then
echo `date +%D-%X` $1 $2 $3 $4 $5 $6 $7 $8 >> /tmpspool/record
fi
$12? Is there a $12 in the call to your script? Do a short test by creating a script that prints $12 and ${12}!
$12 equals $1 followed by the digit 2 I'm afraid. So indeed it's never equal to '' and nothing gets logged.
2) There is a chmod command all alone on a line, without arguments.
In ksh you can also define a variable with a fixed length (typeset -L40: left justified, leading blanks removed, 40 chars, padded on the right with blanks if necessary). Maybe that's of any help.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2004 07:05 AM
04-08-2004 07:05 AM
Re: Script question
Hi, where are the part you have trouble?, i can't find it.
Frank.
Frank.
Linux?. Yes, of course.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2004 07:24 AM
04-08-2004 07:24 AM
Re: Script question
The part that I was having problems with was the following:
if [ "$12" = '' ]
then
echo `date +%D-%X` $1 $2 $3 $4 $5 $6 $7 $8 >> /tmpspool/record
fi
With your help I was able to figure out what needed to be fixed. This is what it now looks like and it seems to be working fine:
if [ "${12}" = '' ]
then
echo `date +%D-%X` $1 $2 $3 $4 $5 $6 $7 $8 >> /tmpspool/record
fi
I had to put brakets around the 12. Thanks for the help.
if [ "$12" = '' ]
then
echo `date +%D-%X` $1 $2 $3 $4 $5 $6 $7 $8 >> /tmpspool/record
fi
With your help I was able to figure out what needed to be fixed. This is what it now looks like and it seems to be working fine:
if [ "${12}" = '' ]
then
echo `date +%D-%X` $1 $2 $3 $4 $5 $6 $7 $8 >> /tmpspool/record
fi
I had to put brakets around the 12. Thanks for the help.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP