- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how can I separate eacho one of fields in the ...
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
Forums
Discussions
Discussions
Discussions
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
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
06-06-2007 04:13 AM
06-06-2007 04:13 AM
Now, I want to put each one of fileds in a file, and as lines.
Also, how do I change all Caps to low cases?
Can sombody please help me with this korn shell scripting?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2007 04:23 AM
06-06-2007 04:23 AM
Re: how can I separate eacho one of fields in the line and put them in the file as lines
cat file |while read line
First=echo $line |awk '{print $1}'
Second=echo $line |awk '{print $2}'
etc
for converting CAPS to LOW use
tr '[A-Z]' '[a-z]'
see man tr for more info
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2007 04:31 AM
06-06-2007 04:31 AM
Re: how can I separate eacho one of fields in the line and put them in the file as lines
> Now, I want to put each one of fileds in a
> file, and as lines.
$ echo ${myvar} | awk '{print $1}' >> field1
> Also, how do I change all Caps to low cases?
There are many ways to do this, but the best way is through a shell built-in:
$ typeset -l mylcvar=${myvar} && echo ${mylcvar}
Other options:
$ echo ${myvar} | tr '[:upper:]' '[:lower:]'
$ echo ${myvar} | dd conv=lcase 2>/dev/null
http://docs.hp.com/en/B2355-90046/
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2007 04:35 AM
06-06-2007 04:35 AM
Solution------------------------------------------
#!/usr/bin/ksh
typeset STAT=0
awk '{ for (i = 1; i <= NF; ++i) print tolower($i); }'
STAT=${?}
exit ${STAT}
--------------------------------------------
Now use it like this:
my.sh < infile > outfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2007 04:44 AM
06-06-2007 04:44 AM