I have this code:
echo `echo "$site_ids" | od -c`
for site_id in $site_ids; do
wp_options_table="wp_$site_id_options"
echo "$wp_options_table"
echo `echo "$site_id" | od -c`
done
it prints this output:
0000000 1 \r \n 2 \r \n 3 \r \n 4 \r \n 5 \r \n 0000017
wp_
0000000 1 \r \n 0000003
wp_
0000000 2 \r \n 0000003
wp_
0000000 3 \r \n 0000003
wp_
0000000 4 \r \n 0000003
wp_
0000000 5 \r \n 0000003
I can't figure out how to remove the \r\n
so that the output is wp_1_options
instead of wp
. Or whatever other problem prevents the output from being wp_1_options
edit I got it working with :
echo "$site_ids" | while IFS=$'\r\n' read site_id
do
wp_options_table="wp_${site_id}_options"
echo "$wp_options_table"
done