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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by chihping

  1. chihping

    Extract lines from a file

    nevermind, I answered my own question. My solution was: sed -n $(($RANDOM % 2156))p filename if anyone was interested =)
  2. chihping

    Extract lines from a file

    Also, how would I apply modulus to it. Because I want random to return a number <2156. I want put $RANDOM%2156, but I am not sure how to use modulus in scripting. Thanks again
  3. chihping

    Extract lines from a file

    hi, I wanted to do something similar to this, but I want to extract a random line number. How would I go about doing this? I have tried to use: sed -n $RANDOMp sonnets.txt but that doesnt seem to work. Thanks in advance

Part and Inventory Search

Back
Top