0

This is my code is bash script:

for string in $LIST
do
echo "$string" >> file
grep -v "#" file1 >> file
done

"file1" contains only one value, and that value changes iteratively.

The result I get in "file" is:

a
1
b
2
c
3

However, I want this:

a 1
b 2
c 3

Thanks in advance.

1
  • What do You mean by this "file1" contains only one value, and that value changes iteratively.. Is it a named pipe? Commented Apr 16, 2013 at 21:30

1 Answer 1

2
for string in $LIST
do
  echo "$string" $(grep -v "#" file1)
done > file
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.