Displaying 2 results from an estimated 2 matches for "totalfiletwo".
2016 Jun 07
2
for loop example
Maybe this don't to be the best form to solve your problem, but worked,rs.
#!/bin/bash
#power by Diego Rodrigues
totalFileOne=$(wc -l file1 | cut -d" " -f1)
totalFileTwo=$(wc -l file2 | cut -d" " -f1)
count=0
if [ ! "${totalFileOne}" -eq "${totalFileTwo}" ];then
echo "The two files need of same number of lines"
exit 1
fi
for ((i=0;$i<${totalFileOne};i++));
do
#add more one to some
NumberLine=$(( $i+1 ))...
2016 Jun 09
0
for loop example
...; ")
On Tue, 07 Jun 2016 12:19:14 +0000
Diego <diegofull at gmail.com> wrote:
> Maybe this don't to be the best form to solve your problem, but worked,rs.
>
> #!/bin/bash
> #power by Diego Rodrigues
>
> totalFileOne=$(wc -l file1 | cut -d" " -f1)
> totalFileTwo=$(wc -l file2 | cut -d" " -f1)
>
> count=0
>
> if [ ! "${totalFileOne}" -eq "${totalFileTwo}" ];then
> echo "The two files need of same number of lines"
> exit 1
> fi
>
>
> for ((i=0;$i<${totalFileOne};i++));
>...