10-01-2009
Quote:
Originally Posted by
jp2542a
awk doesn't/can't return null. It's return (as an int) can be set by the exit directive....
I believe the O/P means an empty string.
10 More Discussions You Might Find Interesting
1. IP Networking
We have a code to find the DNS entry of a host that has a trailing '-' in its url (format example: mysite-.watch.com):
if(gethostbyname_r(host,host_ent,host_buffer,host_buffer_size,&host_error)==NULL)
{
//failed
}
But when remove the '-' from the host name the code does not return... (12 Replies)
Discussion started by: uunniixx
12 Replies
2. Programming
Hi all,
I am trying to write a program in C which will generate private and public keys using openssl RSA and use these for encryption and decryption. I am able to generate the keys successfully and write these to files. I am able to read the private key successfully. I can encrypt and decrypt... (1 Reply)
Discussion started by: Treasa
1 Replies
3. Shell Programming and Scripting
I need to extract a value from a text file into a ksh script, and change the last two letters to "00". awk gets the right value (2500 in this example), but the variable has no value.
I use the following command:
StartTime=expr nawk 'NR==20 {print $11;exit}' $New_FILE
echo 1 $StartTime... (4 Replies)
Discussion started by: Iliklev
4 Replies
4. UNIX for Dummies Questions & Answers
Hi,
How do you echo something once when a find statement returns null results?
This is when using mutiple locations and mutiple arguments.
The below find command the inner loop of a nested for loop where the outter loop holds the $args and the inner loop holds the locations.
find... (2 Replies)
Discussion started by: tchoruma
2 Replies
5. Emergency UNIX and Linux Support
Hello,
I need help adding carriage returns at specific intervals (say 692 characters) to a text file that's one continous string. I'm working in AIX5.3. Any quick help is appreciated.
Thanks! (2 Replies)
Discussion started by: bd_joy
2 Replies
6. Shell Programming and Scripting
I need to get total number of hdisk not assigned to any VGs.
PDC # lspv |grep None |awk '{print $1}' |wc
131 131 1099
So, it shows 131 hdisks.
I need to look at the individual hdisk fget_config info like below:
PDC # fget_config -Av |grep hdisk230
hdisk230 dac1 229... (4 Replies)
Discussion started by: Daniel Gate
4 Replies
7. Shell Programming and Scripting
hello
I have a file with lines of info separated with "|"
I want to amend the second field of the last line, using AWK
my problem is with geting awk to return the last line
this is what I am using
awk 'END{ print $0 }' myFile
but I get an empty result
I tried the... (13 Replies)
Discussion started by: TasosARISFC
13 Replies
8. Shell Programming and Scripting
HSLIST=$1
LFILE=$2
STRING=$3
awk 'BEGIN {
while((getline < "'${HSLIST}'")>0)
S
FS="\n"; RS="}\n"
}
/servicestatus {/ && /service_description='${STRING}'/ {
for(X in D) delete D;
for(N=2; N<=NF; N++)
{
split($N, A, "="); (4 Replies)
Discussion started by: SkySmart
4 Replies
9. Shell Programming and Scripting
I am working on a file with several columns as below
MO_NAME,FAULT_TYPE,CLASS,CODE1,CODE2,CODE3
RXOCF-101,BTS INTERNAL,FAULT CODES CLASS 2A,53,58
RXOCF-101,BTS INTERNAL,FAULT CODES CLASS 2B,24
RXOCF-101,BTS INTERNAL,FAULT CODES CLASS 2A,33
RXOCF-101,BTS INTERNAL,FAULT CODES CLASS 2D,57 ... (12 Replies)
Discussion started by: Rizwan Rasul
12 Replies
10. Shell Programming and Scripting
I'm on Linux version 2.6.32-696.3.1.el6.x86_64, using the Ksh shell.
I'm working with the input file:
John Daggett, 341 King Road, Plymouth MA
Alice Ford, 22 East Broadway, Richmond VA
Orville Thomas, 11345 Oak Bridge Road, Tulsa OK
Terry Kalkas, 402 Lans Road, Beaver Falls PA
Eric Adams,... (2 Replies)
Discussion started by: prooney
2 Replies
LEARN ABOUT PHP
sqlite_escape_string
SQLITE_ESCAPE_STRING(3) SQLITE_ESCAPE_STRING(3)
sqlite_escape_string - Escapes a string for use as a query parameter
SYNOPSIS
string sqlite_escape_string (string $item)
DESCRIPTION
sqlite_escape_string(3) will correctly quote the string specified by $item for use in an SQLite SQL statement. This includes doubling up
single-quote characters ( ') and checking for binary-unsafe characters in the query string.
Although the encoding makes it safe to insert the data, it will render simple text comparisons and LIKE clauses in your queries unusable
for the columns that contain the binary data. In practice, this shouldn't be a problem, as your schema should be such that you don't use
such things on binary columns (in fact, it might be better to store binary data using other means, such as in files).
PARAMETERS
o $item
- The string being quoted. If the $item contains a NUL character, or if it begins with a character whose ordinal value is 0x01,
PHP will apply a binary encoding scheme so that you can safely store and retrieve binary data.
RETURN VALUES
Returns an escaped string for use in an SQLite SQL statement.
NOTES
Note
Do not use this function to encode the return values from UDF's created using sqlite_create_function(3) or sqlite_create_aggre-
gate(3) - use sqlite_udf_encode_binary(3) instead.
Warning
addslashes(3) should NOT be used to quote your strings for SQLite queries; it will lead to strange results when retrieving your
data.
SEE ALSO
sqlite_udf_encode_binary(3).
PHP Documentation Group SQLITE_ESCAPE_STRING(3)