HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- C shell error
Operating System - HP-UX
1829570
Members
1520
Online
109992
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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
09-11-2000 08:11 AM
09-11-2000 08:11 AM
C shell error
Hi.
I am trying to extract from a file certain fields using a foreach loop as follows
foreach gen (`cat davey | cut -d: -f1-2 ` )
and when I run it I get the message
cat davey
cut -d: -f1-2
Too many words from ``.
Can anyone tell me what I am doing wrong.
Dave
I am trying to extract from a file certain fields using a foreach loop as follows
foreach gen (`cat davey | cut -d: -f1-2 ` )
and when I run it I get the message
cat davey
cut -d: -f1-2
Too many words from ``.
Can anyone tell me what I am doing wrong.
Dave
why do i do this to myself
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2000 08:23 AM
09-11-2000 08:23 AM
Re: C shell error
I would guess that the cat | cut commands are generating more values then the shell is able to hold.
I'm no C shell expert but you could get round this in the Posix shell by reading the variable in a loop:-
cut -d: -f1-2 davey | {
while read gen
do
done
}
I'm no C shell expert but you could get round this in the Posix shell by reading the variable in a loop:-
cut -d: -f1-2 davey | {
while read gen
do
done
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2000 12:11 PM
09-11-2000 12:11 PM
Re: C shell error
HI,
`cat davey | cut -d: -f1-2`
this will return first tow fields (words).
for example davey contain following line
aaaa : bbbb:cccc:dddd
then corresponding selection is
aaaa : bbbb
If your aim is to extract only one word, you have to modify command appropriately.
P V Patel
`cat davey | cut -d: -f1-2`
this will return first tow fields (words).
for example davey contain following line
aaaa : bbbb:cccc:dddd
then corresponding selection is
aaaa : bbbb
If your aim is to extract only one word, you have to modify command appropriately.
P V Patel
Punjabhai
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 2025 Hewlett Packard Enterprise Development LP