Monthly Archives: February 2008

mysql: Multiple Table Query, Output into File

Got a request from the boss today to extract all users plus their contact numbers from the Paging server Server is a Red Hat Enterprise Linux AS release 4, running LAMP. The data needed are located in several tables, so we need to query all relevant tables in the databse: mysql> SELECT users.username, users.emailaddress, user_services.current_service … Continue reading

Store a file output in a variable

draft……. note to self #!/bin/bash -x FILE=”/tmp/IAP_sched” DIR=”/PRA/prod/files/nz/area11/logs/” FILE2=$(awk ‘{ print $1 }’ $FILE) echo “*** Nameserver IP ***” for ip in $FILE2 do echo “Doing GTL on” $ip /PRA/prod/scripts/arc/get_log_times *$ip* >> /tmp/output.txt done *alias command is not recognize.. hence the full path of ‘glt’