Using "while" to read columns in a file

Legends,

i am using while to read 4 colums from a file.
but the while loop exits after reading 1st column.

please let me know, how to reach till end of the file.

FILE CONTENT

birdiex1:/home/s/sandeepk/scripts> vi /tmp/gleod_time
"/tmp/gleod_time" [New file]
03_upd_stat_tbl_birdiex1                03_upd_stat_tbl_beauty                  03_upd_stat_tbl_gaston                  03_upd_stat_tbl_belle
03_run_upd_hst_beta_birdiex1            03_run_upd_hst_beta_beauty              03_run_upd_hst_beta_gaston              03_run_upd_hst_beta_belle
03_run_upd_tsc_nzf_birdiex1             03_run_upd_tsc_nzf_beauty               03_run_upd_tsc_nzf_gaston               03_run_upd_tsc_nzf_belle
03_run_upd_tsc_sy_birdiex1              03_run_upd_tsc_sy_beauty                03_run_upd_tsc_sy_gaston                03_run_upd_tsc_sy_belle
03_run_upd_tsc_so_birdiex1              03_run_upd_tsc_so_beauty                03_run_upd_tsc_so_gaston                03_run_upd_tsc_so_belle
03_run_upd_tsc_jgb_birdiex1             03_run_upd_tsc_jgb_beauty               03_run_upd_tsc_jgb_gaston               03_run_upd_tsc_jgb_belle
03_run_upd_tsc_sh_birdiex1              03_run_upd_tsc_sh_beauty                03_run_upd_tsc_sh_gaston                03_run_upd_tsc_sh_belle
03_run_upd_tsc_ph_birdiex1              03_run_upd_tsc_ph_beauty                03_run_upd_tsc_ph_gaston                03_run_upd_tsc_ph_belle
03_run_rollout-tsc-sz_birdiex1          03_run_rollout-tsc-sz_beauty            03_run_rollout-tsc-sz_gaston            03_run_rollout-tsc-sz_belle

CODE:

while read col1_birdiex1 col2_beauty col3_gaston col4_belle
do
jobhist act $col1_birdiex1|tail -1"
ssh beauty ". .bash_profile > /dev/null 2>&1; jobhist act $col2_beauty|tail -1"
ssh beauty ". .bash_profile > /dev/null 2>&1; jobhist act $col3_gaston|tail -1"
ssh belle ". .bash_profile > /dev/null 2>&1; jobhist act $col4_belle|tail -1"
echo " "
done < /tmp/gleod_time

OUTPUT

it comes out of loop after 1st line

/scripts> while read col1_birdiex1 col2_beauty col3_gaston col4_belle; do jobhist act $col1_birdiex1; ssh beauty ". .bash_profile > /dev/null 2>&1; jobhist act $col2_beauty|tail -1"; ssh beauty ". .bash_profile > /dev/null 2>&1; jobhist act $col3_gaston|tail -1"; ssh belle ". .bash_profile > /dev/null 2>&1; jobhist act $col4_belle|tail -1"; echo " "; done < /tmp/gleod_time

                START TIME REPORT HAS BEEN GENERATED FOR JOB(S):        1
============================================================================================
|        JOB                   |     SCHEDULE    |       LAST      |       LAST     |  JOB |
|                              |-----------------|                 |                | DURAT|
|        NAME                  |ind|    hh:mm    |       START     |       END      | (min)|
============================================================================================
03_upd_stat_tbl_birdiex1        b   07:00          08:30  09/28/13   08:51  09/28/13  20.3
03_upd_stat_tbl_beauty          b   07:00          07:25  09/28/13   07:41  09/28/13  15.2
03_upd_stat_tbl_gaston          b   07:00          08:40  09/28/13   08:57  09/28/13  16.9
03_upd_stat_tbl_belle           b   07:00          11:46  09/28/13   12:00  09/28/13  14.6

/scripts> 

ssh sucks from stdin (i.e. the loop's input).
Use

ssh -n ...
1 Like

@MadeInGermany... It worked