7.4 quoting

Started by Steve Clarkabout 15 years ago4 messagesgeneral
Jump to latest
#1Steve Clark
sclark@netwolves.com

Hi List,

I am having a problem trying to do the following:
ssh postgres@192.168.198.93 'psql -Atc "select a.interface, a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface = b.interface and config ilike '%cost 50%';" config.db'

bash turns it into this:
ssh postgres@192.168.198.93 'psql -Atc "select a.interface, a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface = b.interface and config ilike %cost' '50%;" config.db'

I tried various things using \' or '' or ''' but none work.
I have even tried exchanging the outer " with ' and the inner "select to 'select but still no success.

Any ideas?

With 8.x databases I use \$\$%cost 50%\$\$ which work great.
--
Stephen Clark
*NetWolves*
Sr. Software Engineer III
Phone: 813-579-3200
Fax: 813-882-0209
Email: steve.clark@netwolves.com
http://www.netwolves.com

#2Arjen Nienhuis
a.g.nienhuis@gmail.com
In reply to: Steve Clark (#1)
Re: 7.4 quoting

On Thu, Mar 31, 2011 at 18:56, Steve Clark <sclark@netwolves.com> wrote:

Hi List,

I am having a problem trying to do the following:
ssh postgres@192.168.198.93 'psql -Atc "select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface
= b.interface and config ilike '%cost 50%';" config.db'

bash turns it into this:
ssh postgres@192.168.198.93 'psql -Atc "select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface
= b.interface and config ilike %cost' '50%;" config.db'

try:

ssh postgres@192.168.198.93 'psql -Atc "select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
a.interface = b.interface and config ilike '%cost 50%';" config.db'

which bash turns into:

ssh postgres@192.168.198.93 psql -Atc "select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
a.interface = b.interface and config ilike '%cost 50%'" config.db

#3Arjen Nienhuis
a.g.nienhuis@gmail.com
In reply to: Arjen Nienhuis (#2)
Re: 7.4 quoting

On Thu, Mar 31, 2011 at 20:05, Arjen Nienhuis <a.g.nienhuis@gmail.com> wrote:

On Thu, Mar 31, 2011 at 18:56, Steve Clark <sclark@netwolves.com> wrote:

Hi List,

I am having a problem trying to do the following:
ssh postgres@192.168.198.93 'psql -Atc "select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface
= b.interface and config ilike '%cost 50%';" config.db'

bash turns it into this:
ssh postgres@192.168.198.93 'psql -Atc "select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface
= b.interface and config ilike %cost' '50%;" config.db'

try:

ssh postgres@192.168.198.93 'psql -Atc "select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
a.interface = b.interface and config ilike '%cost 50%';" config.db'

which bash turns into:

ssh postgres@192.168.198.93 psql -Atc "select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
a.interface = b.interface and config ilike '%cost 50%'" config.db

Argh!

I mean:

ssh postgres@192.168.198.93 psql -Atc \"select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
a.interface = b.interface and config ilike \'%cost 50%\'\" config.db

#4Steve Clark
sclark@netwolves.com
In reply to: Arjen Nienhuis (#3)
Re: 7.4 quoting

On 03/31/2011 02:06 PM, Arjen Nienhuis wrote:

On Thu, Mar 31, 2011 at 20:05, Arjen Nienhuis<a.g.nienhuis@gmail.com> wrote:

On Thu, Mar 31, 2011 at 18:56, Steve Clark<sclark@netwolves.com> wrote:

Hi List,

I am having a problem trying to do the following:
ssh postgres@192.168.198.93 'psql -Atc "select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface
= b.interface and config ilike '%cost 50%';" config.db'

bash turns it into this:
ssh postgres@192.168.198.93 'psql -Atc "select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface
= b.interface and config ilike %cost' '50%;" config.db'

try:

ssh postgres@192.168.198.93 'psql -Atc "select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
a.interface = b.interface and config ilike '%cost 50%';" config.db'

which bash turns into:

ssh postgres@192.168.198.93 psql -Atc "select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
a.interface = b.interface and config ilike '%cost 50%'" config.db

Argh!

I mean:

ssh postgres@192.168.198.93 psql -Atc \"select a.interface,
a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where
a.interface = b.interface and config ilike \'%cost 50%\'\" config.db

Great! that did it thanks a bunch!!!

Regards,
Steve

--
Stephen Clark
*NetWolves*
Sr. Software Engineer III
Phone: 813-579-3200
Fax: 813-882-0209
Email: steve.clark@netwolves.com
http://www.netwolves.com