

InterviewSolution
Saved Bookmarks
1. |
Solve : HOW CAN I PRINT FROM LIN 10 TO 34 IN ANY FILE USING HEAD AND TAIL COMMAND? |
Answer» HOW CAN I PRINT LINE 10 TO 34 IN ANY FILE USING HEAD AND TAIL COMMAND IN UNIX SYSTEM?cat the file, via a pipe to head to get the first 34 lines of the file, then another pipe to tail to get the last 24 lines of that. (34-10=24). If you meant print to a line printer, redirect the output to the printer device. HOW CAN I PRINT LINE 10 TO 34 IN ANY FILE USING HEAD AND TAIL COMMAND IN UNIX SYSTEM? no need to SHOUT! Code: [Select]tail +10 filename | head -24 | lpdoing homework right? if not, there's no reason you can't use sed Code: [Select]sed -n '10,34p' file Good one, Ghostdog http://gnuwin32.sourceforge.net/packages/sed.htm http://www.student.northpark.edu/pemente/sed/sed1line.txt |
|