GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- read cmd truncating leading spaces
Operating System - HP-UX
1855298
Members
2167
Online
104109
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp
Knowledge Base
Discussions
Forums
Discussions
back
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
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
03-24-2003 12:22 PM
03-24-2003 12:22 PM
I'm trying to use the read command such as:
while read LINE
do
process stuff...
done < input.file
input.file looks something like:
line1 starting pos 3
line2 starting pos 3
line3 starting pos 3
etc...
When I examine the var "$LINE"
it looks like:
line1 starting pos 3
line2 starting pos 3
line3 starting pos 3
How can I get the read command to leave the leading spaces intact???
Also, the UNIX 'line' command was not a viable alternative.
Thanks,
jg
while read LINE
do
process stuff...
done < input.file
input.file looks something like:
line1 starting pos 3
line2 starting pos 3
line3 starting pos 3
etc...
When I examine the var "$LINE"
it looks like:
line1 starting pos 3
line2 starting pos 3
line3 starting pos 3
How can I get the read command to leave the leading spaces intact???
Also, the UNIX 'line' command was not a viable alternative.
Thanks,
jg
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2003 12:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2003 01:00 PM
03-24-2003 01:00 PM
Re: read cmd truncating leading spaces
Also try:
perl -pe 1 file
For one line at a time in Perl.
perl -pe 1 file
For one line at a time in Perl.
Support Fatherhood - Stop Family Law
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