- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- 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 02:29 AM
тАО12-22-2004 02:29 AM
Writing Variables to a File
I need to write several variables to a file. I'm trying...
echo "$CPU $TTY $PID $USERNAME $PRI $NI $SIZE $RES $STATE $TIME $WCPU $CPU $COMMAND" > /home/sysadmin/topcpu/check_cpu.txt
but it is not working. Can someone tell me what I'm doing wrong?
Thanks to all
Scott
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 02:38 AM
тАО12-22-2004 02:38 AM
Re: Writing Variables to a File
What kind of content do you get in the file (empty)?
Is this run from a script with a different environment or other variable settings?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 02:40 AM
тАО12-22-2004 02:40 AM
Re: Writing Variables to a File
You will see everything you need and then some.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 02:44 AM
тАО12-22-2004 02:44 AM
Re: Writing Variables to a File
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 02:53 AM
тАО12-22-2004 02:53 AM
Re: Writing Variables to a File
ls -l /home/sysadmin/topcpu
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 02:54 AM
тАО12-22-2004 02:54 AM
Re: Writing Variables to a File
Do you get an error message?
Or what do you find in the file if it is created at all?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 02:55 AM
тАО12-22-2004 02:55 AM
Re: Writing Variables to a File
I just tried your echo, and I get the script created (empty line because none of the VARs have values...) so I suspect you have something wrong with the permissions on your directory, has whatever executes the script the write permission to that directory?
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 02:55 AM
тАО12-22-2004 02:55 AM
Re: Writing Variables to a File
# set -o|grep clobber
noclobber off
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 02:57 AM
тАО12-22-2004 02:57 AM
Re: Writing Variables to a File
even if the file should at least be created.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 03:00 AM
тАО12-22-2004 03:00 AM
Re: Writing Variables to a File
I guess you parse the top dump from something similar to
top -d 2 -f /tmp/top.dump