Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • How do you execute this? source script_name ? You probably need to add #!/bin/bash if your script is executable Commented Oct 22, 2013 at 21:24
  • 1
    The script is fine. However split -l 50000 pa.txt pa is much easier. If you want to keep the pa01.txt format, run this next: let c=1; for i in pa??; do mv $i $(printf "pa%02d.txt" $c); let c++; done Commented Oct 22, 2013 at 21:38
  • 4
    Sounds like classic carriage return issue (lines ended with CRLF instead of LF as if written for Microsoft OSes). Commented Oct 22, 2013 at 22:12