CCCPaste

73f204925ac29

# Command works when entered in bash terminal as follows:
# agg -q mega "SELECT idps.name idp_name, \
# props.name prop_name, \
# props.type prop_type, \
# props.host prop_host, \
# CHARACTER_LENGTH(props.origin_host) origin_length, \
# props.origin_host, \
# props.fossl_hostnames, \
# props.fossl_enabled \
# FROM mcdnportal_sso_idps idps \
# LEFT OUTER JOIN \
# mcdnportal_sso_properties props \
# ON idps.id = props.idp_id \
# WHERE idps.name SIMILAR '^USAF\ CCE\ Prod\ -\ LDAP$' \
# OR idps.name SIMILAR '^USAF\ CCE\ Test\ -\ LDAP$' \
# OR idps.name SIMILAR '^USAF\ CCE\ Test\ -\ Headless$' \
# OR idps.name SIMILAR '^USAF\ CCE\ Prod\ -\ Headless$' \
# ORDER BY idps.name, props.name"
[dbowling@a214-48-2-21 bin]$ cat -n test.pl
1 #!/usr/bin/env perl
2
3 use strict;
4 use warnings;
5
6 my $query = `agg -q mega "SELECT idps.name idp_name, \
7 props.name prop_name, \
8 props.type prop_type, \
9 props.host prop_host, \
10 CHARACTER_LENGTH(props.origin_host) origin_length, \
11 props.origin_host, \
12 props.fossl_hostnames, \
13 props.fossl_enabled \
14 FROM mcdnportal_sso_idps idps \
15 LEFT OUTER JOIN \
16 mcdnportal_sso_properties props \
17 ON idps.id = props.idp_id \
18 WHERE idps.name SIMILAR '^USAF\ CCE\ Prod\ -\ LDAP$' \
19 OR idps.name SIMILAR '^USAF\ CCE\ Test\ -\ LDAP$' \
20 OR idps.name SIMILAR '^USAF\ CCE\ Test\ -\ Headless$' \
21 OR idps.name SIMILAR '^USAF\ CCE\ Prod\ -\ Headless$' \
22 ORDER BY idps.name, props.name"`;
23
24 print "$query\n";
[dbowling@a214-48-2-21 bin]$ perl test.pl
Use of uninitialized value $' in concatenation (.) or string at test.pl line 6.
Use of uninitialized value $' in concatenation (.) or string at test.pl line 6.
Use of uninitialized value $' in concatenation (.) or string at test.pl line 6.
Use of uninitialized value $' in concatenation (.) or string at test.pl line 6.
error: syntax error on line 14 at '^'