Hi All,
I am pretty new to pattern matching and extraction using shell scripting. Could anyone please help me in extracting the word matching a pattern from a line in bash.
Input Sample (can vary between any of the 3 samples below):
1) Adaptec SCSI RAID 5445
2) Adaptec SCSI 5445S RAID
3)... (8 Replies)
Hello Everyone,
I just started scripting this week. I have no background in programming or scripting.
I'm working on a script to grep for a variable in a log file
Heres what the log file looks like. The x's are all random clutter
xxxxxxxxxxxxxxxxxxxxx START: xxxxxxxxxxxx... (7 Replies)
Hi,
I have two variables x and y.
i need to find a particular string in a file, a workflow name and then insert the values of x and y into the next lines of the workflow name.
basically it is like as below
wf_xxxxxx
$$a=
$$b=
$$c= figo
$$d=bentley
i need to grep the 'wf_xxxx' and then... (6 Replies)
Right now, my code is:
s/Secondary Ins./Secondary Ins.\
1/g
It's adding a 1 as soon as it finds Secondary Ins.
Primary Ins.: MEDICARE B DMERC Secondary Ins.
1: CONTINENTAL LIFE INS
What I really want to achieve is having a 1 added on the next line that contain "Secondary Ins." It... (4 Replies)
Hi, i need help with my shell script
I have a file input.txt containing the following contents
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/wine
/usr/share/doc/wine/copyright
/usr/share/doc/wine/changelog.Debian.gz
I need output as
/usr/share/doc/wine
/usr/share/doc/wine/copyright... (3 Replies)
Hi all,
can some one help me out
file 1 i have
06/01 3:14 d378299
06/01 8:10 d642036
06/01 10:51 d600441
06/01 10:52 d600441
06/01 11:11 d607339
06/01 11:49 d398706
something like this and in file named list i have ( there is space btwn 06/01 and 11:49 and d398706)
d607339... (5 Replies)
hi guys
i am trying to convert a uppercase var to a lowercase var and the result is pass in to another var. But i kept getting error from the variable that will be containing the result of the conversion of uppercase to the lowercase.
DB_SID=TEST
DB_SID_SM=/opt/$DB_SID | tr ''... (5 Replies)
so im searching the process table with:
ps -ef | awk -F"./rello.java" '{ print substr($0, index($0,$2)) }'
I only want it to print everything that's infront of the "./rello.java". That's because im basically getting the arguments that was passed to the rello.java script.
this works.
... (2 Replies)
Hi All
I'm trying to insert a new line at the before each comment line in a file.
Comment lines start with '#-----'
there are other comments with in lines but I don't want a new line there.
Example file:
blah
blah #do not insert here
#this is a comment
blah #some more
#another comment... (10 Replies)
Discussion started by: Mudshark
10 Replies
LEARN ABOUT PHP
cubrid_real_escape_string
CUBRID_REAL_ESCAPE_STRING(3) 1 CUBRID_REAL_ESCAPE_STRING(3)cubrid_real_escape_string - Escape special characters in a string for use in an SQL statementSYNOPSIS
string cubrid_real_escape_string (string $unescaped_string, [resource $conn_identifier])
DESCRIPTION
This function returns the escaped string version of the given string. It will escape the following characters: '. In general, single quo-
tations are used to enclose character string. Double quotations may be used as well depending on the value of ansi_quotes, which is a
parameter related to SQL statement. If the ansi_quotes value is set to no, character string enclosed by double quotations is handled as
character string, not as an identifier. The default value is yes. If you want to include a single quote as part of a character string,
enter two single quotes in a row.
PARAMETERS
o $unescaped_string
-The string that is to be escaped.
o $conn_identifier
- The CUBRID connection. If the connection identifier is not specified, the last connection opened by cubrid_connect(3) is
assumed.
RETURN VALUES
Escaped string version of the given string, on success.
FALSE on failure.
EXAMPLES
Example #1
cubrid_real_escape_string(3) example
<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$unescaped_str = ' !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~';
$escaped_str = cubrid_real_escape_string($unescaped_str);
$len = strlen($unescaped_str);
@cubrid_execute($conn, "DROP TABLE cubrid_test");
cubrid_execute($conn, "CREATE TABLE cubrid_test (t char($len))");
cubrid_execute($conn, "INSERT INTO cubrid_test (t) VALUES('$escaped_str')");
$req = cubrid_execute($conn, "SELECT * FROM cubrid_test");
$row = cubrid_fetch_assoc($req);
var_dump($row);
cubrid_close_request($req);
cubrid_disconnect($conn);
?>
The above example will output:
array(1) {
["t"]=>
string(95) " !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~"
}
PHP Documentation Group CUBRID_REAL_ESCAPE_STRING(3)