- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- read in 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
тАО07-16-2002 09:30 PM
тАО07-16-2002 09:30 PM
read in file
a file using a script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-16-2002 09:41 PM
тАО07-16-2002 09:41 PM
Re: read in file
Please refer to:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xbe4ac4c76f92d611abdb0090277a778c,00.html
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-17-2002 05:31 AM
тАО07-17-2002 05:31 AM
Re: read in file
HTH
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-17-2002 05:48 AM
тАО07-17-2002 05:48 AM
Re: read in file
you can use the dd- command:
dd if=/path/to/file bs=1 count=30
brings 30 bytes to standard output.
var=`dd if=/path/to/file bs=1 count=30`
gives the first 30 bytes of your file as value to the variable "var"
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-17-2002 06:24 AM
тАО07-17-2002 06:24 AM
Re: read in file
head -c -n 1000 filex >first1000bytes
Would copy only the first 1000 bytes from filex.
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-17-2002 06:26 AM
тАО07-17-2002 06:26 AM
Re: read in file
open F1, "
# $n - number of bytes read
# $s_in contains the data up to 8192 bytes
# now seek to offset 32768 and read again
seek(F1,32768,0);
$n = read(f1,$s_in,8192);
close F1;
You would, of course, need to add some error checking but this is the clean scripting way to do this.