Re: for loop in bash script over two variables

From: Barry Margolin (barry.margolin_at_level3.com)
Date: 10/23/03


Date: Thu, 23 Oct 2003 21:45:20 GMT

In article <a6a2b8c.0310231341.5ad96bd8@posting.google.com>,
Jeevan <kjeevan_kumar@yahoo.com> wrote:
>Hi,
>
>I have two files, one (f1) which contains the list of files and other
>(f2) which contains list of their sizes respectively. I am trying to
>write a bash script which prints the name of the file and then its
>size. I was trying to use the following code but it is not working.
>
>files=`(cat f1)`
>sizes=`(cat f2)`
>for file in $files
>do

paste f1 f2

-- 
Barry Margolin, barry.margolin@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


Relevant Pages

  • Re: for loop in bash script over two variables
    ... 2003/10/23, 14:41, Jeevan: ... > which contains list of their sizes respectively. ... IFS= ... But you'd probably better use awk to be more efficient/portable: ...
    (comp.unix.shell)
  • Re: problems with foreach, c shell
    ... Pushkar Pradhan wrote: ... >foreach n (SIZES) ... *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups. ...
    (comp.unix.shell)