- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Writing Variables to a File
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
тАО12-22-2004 03:20 AM
тАО12-22-2004 03:20 AM
Re: Writing Variables to a File
- Tags:
- missing attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 03:27 AM
тАО12-22-2004 03:27 AM
Re: Writing Variables to a File
top -d 1 -n 1 -f /home/sysadmin/topcpu/topck.txt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 03:41 AM
тАО12-22-2004 03:41 AM
Re: Writing Variables to a File
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 03:56 AM
тАО12-22-2004 03:56 AM
Re: Writing Variables to a File
In your script you read in a command into the variable COMM.
However you use the variable COMMAND rather than COMM in several places, including an IF statement. Fix that and you might see a bit of progress.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 04:13 AM
тАО12-22-2004 04:13 AM
Re: Writing Variables to a File
Stupid question, but have you tried to run your script with the shell's poor man's debugger "sh -x"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 04:16 AM
тАО12-22-2004 04:16 AM
Re: Writing Variables to a File
(I hope not on your screen ;-)
So at least one of us is heaving a white Xmas.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 05:45 AM
тАО12-22-2004 05:45 AM
Re: Writing Variables to a File
I've got a lot of replies to look into. I'll assign points accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 06:01 AM
тАО12-22-2004 06:01 AM
Re: Writing Variables to a File
Yes /home/sysadmin/topcpu exists
Permissions are set as root, running script as root.
Changed COMMAND to COMM, still doesn't create files.
And yes, some of my if statements do evalutate to true.
Seems like this should be so easy, I don't know why I can't get these files to create. I'm sure I've missed something.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 06:06 AM
тАО12-22-2004 06:06 AM
Re: Writing Variables to a File
echo "$var1 $var2" > /newfile.txt
My problem was my last if statement wasn't evaluating the correct variable. Oversight on my part.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 06:06 AM
тАО12-22-2004 06:06 AM
Re: Writing Variables to a File
# sh -x scriptname
Or just put
#!/usr/bin/sh -x
at the top of the script, execute it and attach the results. Maybe the trace will give us some more clues.