Hi ,
Thanks jeetu ,
I got one more way , which is as followes
#!/bin/sh -
array0=(`cat /tmp/name`); array1=(`cat /tmp/age`); array2=(`cat
/tmp/country`)
for i in `seq 0 [EMAIL PROTECTED]; do
echo "${array0[$i]},${array1[$i]},${array2[$i]}"
done
exit 0
Thanks & regards
Jayesh
jeetendra poojary <[EMAIL PROTECTED]> wrote:
jay shi <[EMAIL PROTECTED]> wrote:
>I trying to write the shell script , which will take variables from a 3
different files , and display all at once on one line.
>Example :--
>======
>I have following 3 files , which contain data in following order
>1) /tmp/name
>2) /tmp/age
>3) /tmp/country
>[EMAIL PROTECTED] ~]# cat /tmp/name
>"sachin"
>"lara"
>"rahul"
>[EMAIL PROTECTED] ~]# cat /tmp/age
>"35"
>"38"
>"32"
>[EMAIL PROTECTED] ~]# cat /tmp/country
>"India"
>"Westindies"
>"India"
>Now I want the output as follows :--
>"sachin","India","35"
>"lara","Westindies","38"
>"raul","India","32"
use this command
paste -d, /tmp/name /tmp/country /tmp/age
Jeetu
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Non-text portions of this message have been removed]
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Non-text portions of this message have been removed]