#!/bin/bash
counter=1
invoice_clause=""
while read line
do
if [ $count == 1 ]
then
#invoice_clause="'$line'"
echo "if then"
else
invoice_clause="$invoice_clause,'$line'"
fi
counter=`expr $counter + 1`
done < invoices.num
echo $invoice_clause
Input file :
one
two
three
four
five
Output:
'one','two','three','four','five'
counter=1
invoice_clause=""
while read line
do
if [ $count == 1 ]
then
#invoice_clause="'$line'"
echo "if then"
else
invoice_clause="$invoice_clause,'$line'"
fi
counter=`expr $counter + 1`
done < invoices.num
echo $invoice_clause
Input file :
one
two
three
four
five
Output:
'one','two','three','four','five'
No comments:
Post a Comment