Re: Counting lines of a textfile

2002-09-27 Thread Cameron Simpson
On 16:38 23 Sep 2002, Spanke, Alexander [EMAIL PROTECTED] wrote: | Hi again, | | How can i count the lines of a text file and store it in a variable. But i | should use the bash, so no perl, python script should it be. | | Now i use | wc -l file.txt | read dummy | | But it doesn't work

Counting lines of a textfile

2002-09-23 Thread Spanke, Alexander
Hi again, How can i count the lines of a text file and store it in a variable. But i should use the bash, so no perl, python script should it be. Now i use wc -l file.txt | read dummy But it doesn't work :( Any ideas ? Regards / thnx Alex

Re: Counting lines of a textfile

2002-09-23 Thread Bruno Negrao
Try: VAR=`wc -l /etc/passwd` this way the $VAR gets the output of the command executed inside the ` `. - Original Message - From: Spanke, Alexander [EMAIL PROTECTED] To: 'RedHat General - Mailinglist' [EMAIL PROTECTED] Sent: Monday, September 23, 2002 11:38 AM Subject: Counting lines

Re: Counting lines of a textfile

2002-09-23 Thread Emmanuel Seyman
On Mon, Sep 23, 2002 at 04:38:21PM +0200, Spanke, Alexander wrote: How can i count the lines of a text file and store it in a variable. But i should use the bash, so no perl, python script should it be. [seyman@munshine seyman]$ linecount=`wc -l file.txt` [seyman@munshine seyman]$ echo

Re: Counting lines of a textfile

2002-09-23 Thread Francisco Neira
Spanke, Alexander wrote: Hi again, How can i count the lines of a text file and store it in a variable. But i should use the bash, so no perl, python script should it be. Now i use wc -l file.txt | read dummy But it doesn't work :( Any ideas ? Regards / thnx Alex