Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

csplit out of range

Status
Not open for further replies.

tomte

Technical User
Nov 14, 2002
47
US
Here is the problem. I want to split a file on the first instance of an expression. Example:

Julie
Jim
Bill
Steve
John
Jay
Bill
Bob
Bill
etc

If I use the command /usr/bin/csplit -k -f /var/name /var/name '/Bill/' from the shell prompt I get the two files I am looking for. If I use the same command within a script I get a /Bill - out of range error.

I only want to split off the first occurance. Any ideas?
 
And what about a awk program like this:
Code:
/Bill/{exit}
{print}

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top