Hi everybody,
i am using the tcsh under freebsd
i want query a mysql DB wich have approx 100 entrys and generate
multiple template files.
The problem is that the direct output to a variable doesnt work there
are differences between the output into a text file and a variable.
I don't want to use a text file for data generation.
is there any possibility to preformat the variable input in that form
that i can do an echo $variable and get an output like sample OUTPUT2 ?
Regards Michael
-- Output1: directly at a tcsh
host01:/home/ux/mytest> host01:/home/ux/mytest> echo "select
id,nr,color,length,type,count(length) from patch.cable group by
length,type,color;" | mysql -ur -pr -B
id nr color length type count(length)
032 132 grey 1000 std 6
020 120 grey 2000 std 12
001 100 grey 3000 std 13
Output2: generated in a tcsh and written to a file
host01:/home/ux/mytest> echo "select
id,nr,color,length,type,count(length) from patch.cable group by
length,type,color;" | mysql -ur -pr -B > test1.txt
host01:/home/ux/mytest> less test1.txt
id nr color length type count(length)
032 132 grey 1000 std 6
020 120 grey 2000 std 12
001 100 grey 3000 std 13
Output3 generated in a tcsh and written to a variable
host01:/home/ux/mytest> set test125=`echo "select
id,nr,color,length,type,count(length) from patch.cable group by
length,type,color;" | mysql -ur -pr -B`
host01:/home/ux/mytest> echo $test125
id nr color length type count(length) 032 132 grey 1000 std 6 020 120
grey 2000 std 12 001 100 grey 3000 std 13