Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to pass a single quote to the program? Post 303036116 by RudiC on Friday 14th of June 2019 09:29:01 AM
Old 06-14-2019
You definitely need to split your pipeline into single commands and analyse each one of them separately in order to identify what is going wrong. I don't know the voronota command, what it requires, and what its outputs should look like, but piping some file through three instances of it is somewhat new to me.


Re. your single quote question, to me the double quoting seems to do exactly what you need. echoing your third voronota command with the respective variables and quoting yields:
Code:
echo voronota query-contacts --inter-residue --match-first "'R<$AAA>'" --match-second "'A<C1',C2',C3',C4',C5',O1,O2,O3,O4,O5,O1',O2',O3',O4',O5',N1,N2,N3,C1,C2,C3,C4,C5>'" 
voronota query-contacts --inter-residue --match-first 'R<ALA>' --match-second 'A<C1',C2',C3',C4',C5',O1,O2,O3,O4,O5,O1',O2',O3',O4',O5',N1,N2,N3,C1,C2,C3,C4,C5>'

These 2 Users Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replacing a single quote

Hi there I have a data file like so below 'A/1';'T100002';'T100002';'';'01/05/2004';'31/05/2004';'01/06/2004';'08/06/2004';'1.36';'16';'0.22';'0';'0';'1.58';'0';'0';'0';'0';'0';'0';'clientes\resumen\200405\resumen_T100002_T100002_1.pdf';'';'0001';'S';'20040501';'';'02';'0';'S';'N'... (3 Replies)
Discussion started by: rjsha1
3 Replies

2. Shell Programming and Scripting

single quote

Hi I have a shell script with many lines as below: comment on column dcases.proj_seq_num is dcases_1sq; .... .... I want the above script to be as below: comment on column dcases.proj_seq_num is 'dcases_1sq'; I want to have single quotes like that as above for the entire shell... (2 Replies)
Discussion started by: dreams5617
2 Replies

3. Shell Programming and Scripting

escaping single quote

hi, echo 'abc' will give output abc how can i get output as 'abc' plz help. thanks in advance (3 Replies)
Discussion started by: javeed7
3 Replies

4. Shell Programming and Scripting

Regex in grep to match all lines ending with a double quote (") OR a single quote (')

Hi, I've been trying to write a regex to use in egrep (in a shell script) that'll fetch the names of all the files that match a particular pattern. I expect to match the following line in a file: Name = "abc" The regex I'm using to match the same is: egrep -l '(^) *= *" ** *"$' /PATH_TO_SEARCH... (6 Replies)
Discussion started by: NanJ
6 Replies

5. Shell Programming and Scripting

Replace single quote with two single quotes in perl

Hi I want to replace single quote with two single quotes in a perl string. If the string is <It's Simpson's book> It should become <It''s Simpson''s book> (3 Replies)
Discussion started by: DushyantG
3 Replies

6. Shell Programming and Scripting

single quote replacement

hi all, i have a data in the file which of the formate : 100,102,103 and the required formate is \'100\',\'102\',\'103 Idealy we need to replace , with \',\' Regards arkesh (2 Replies)
Discussion started by: arkeshtk
2 Replies

7. Shell Programming and Scripting

How to insert a single quote to each record

I have a file as: 1 New used 1 used New I need o/p as: '1' 'New' 'used' '1' 'used' 'New' (12 Replies)
Discussion started by: karumudi7
12 Replies

8. Shell Programming and Scripting

Replacing all but the first and last double quote in a line with a single quote with awk

From: 1,2,3,4,5,This is a test 6,7,8,9,0,"This, is a test" 1,9,2,8,3,"This is a ""test""" 4,7,3,1,8,"""" To: 1,2,3,4,5,This is a test 6,7,8,9,0,"This; is a test" 1,9,2,8,3,"This is a ''test''" 4,7,3,1,8,"''"Is there an easy syntax I'm overlooking? There will always be an odd number... (5 Replies)
Discussion started by: Michael Stora
5 Replies

9. Shell Programming and Scripting

Awk: single quote match in If

Hello, I'd like to print line if column 5th doesn't match with exm. But to reach there I have to make sure I match single quote. I'm struggling to match that. I've input file like: Warning: Variants 'exm480340' and '5:137534453:G:C' have the same position. Warning: Variants 'exm480345'... (9 Replies)
Discussion started by: genome
9 Replies

10. Shell Programming and Scripting

Single quote _error_.

Hi all... (This is Don's domain.) I have come across an anomaly in sh and dash compared to bash. It involves echoing a character set to a file in sh and dash compared to bash. It is probably easier to show the code and results first. #!/usr/local/bin/dash #!/bin/sh #!/bin/bash echo... (4 Replies)
Discussion started by: wisecracker
4 Replies
PG_QUERY_PARAMS(3)														PG_QUERY_PARAMS(3)

pg_query_params  -  Submits  a command to the server and waits for the result, with the ability to pass parameters separately from the SQL command
text.

SYNOPSIS
resource pg_query_params ([resource $connection], string $query, array $params) DESCRIPTION
Submits a command to the server and waits for the result, with the ability to pass parameters separately from the SQL command text. pg_query_params(3) is like pg_query(3), but offers additional functionality: parameter values can be specified separately from the command string proper. pg_query_params(3) is supported only against PostgreSQL 7.4 or higher connections; it will fail when using earlier versions. If parameters are used, they are referred to in the $query string as $1, $2, etc. The same parameter may appear more than once in the $query; the same value will be used in that case. $params specifies the actual values of the parameters. A NULL value in this array means the corresponding parameter is SQL NULL. The primary advantage of pg_query_params(3) over pg_query(3) is that parameter values may be separated from the $query string, thus avoid- ing the need for tedious and error-prone quoting and escaping. Unlike pg_query(3), pg_query_params(3) allows at most one SQL command in the given string. (There can be semicolons in it, but not more than one nonempty command.) PARAMETERS
o $connection - PostgreSQL database connection resource. When $connection is not present, the default connection is used. The default connection is the last connection made by pg_connect(3) or pg_pconnect(3). o $query - The parameterized SQL statement. Must contain only a single statement. (multiple statements separated by semi-colons are not allowed.) If any parameters are used, they are referred to as $1, $2, etc. User-supplied values should always be passed as param- eters, not interpolated into the query string, where they form possible SQL injection attack vectors and introduce bugs when han- dling data containing quotes. If for some reason you cannot use a parameter, ensure that interpolated values are properly escaped. o $params - An array of parameter values to substitute for the $1, $2, etc. placeholders in the original prepared query string. The number of elements in the array must match the number of placeholders. Values intended for bytea fields are not supported as parameters. Use pg_escape_bytea(3) instead, or use the large object functions. RETURN VALUES
A query result resource on success or FALSE on failure. EXAMPLES
Example #1 Using pg_query_params(3) <?php // Connect to a database named "mary" $dbconn = pg_connect("dbname=mary"); // Find all shops named Joe's Widgets. Note that it is not necessary to // escape "Joe's Widgets" $result = pg_query_params($dbconn, 'SELECT * FROM shops WHERE name = $1', array("Joe's Widgets")); // Compare against just using pg_query $str = pg_escape_string("Joe's Widgets"); $result = pg_query($dbconn, "SELECT * FROM shops WHERE name = '{$str}'"); ?> SEE ALSO
pg_query(3). PHP Documentation Group PG_QUERY_PARAMS(3)
All times are GMT -4. The time now is 03:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy