Sponsored Content
Top Forums Shell Programming and Scripting Need help interpreting a function Post 302386394 by Cheranime on Tuesday 12th of January 2010 10:30:42 AM
Old 01-12-2010
Need help interpreting a function

Hi, i was reading through a sample coding and came across this function, can anyone pls help to interpret the code for me. Thank alot

Code:
find_lines()
{
    res=-1
    if [ ! -z "$1" ]; then
        grep -i "$@" $FILENAME
        res=$?
    fi
    return $res
}


Last edited by Cheranime; 01-12-2010 at 11:36 AM.. Reason: use code tags and indention please, ty
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Interpreting netstat -s

Are there any references I can look up for to interprete "netstat -s", especially those on TCP statistics. (6 Replies)
Discussion started by: deaniyoer
6 Replies

2. UNIX for Dummies Questions & Answers

Shellscript Interpreting

I am trying to interpret the following shellscript and am having a very difficult time. Could one of you Unix gurus pleasssseeee help me out? You just won't know how much of a life saver you would be for me. PN=`basename "$0"` # Program name VER=`echo '$Revision: 1.2 $' | cut -d' ' -f2` ... (3 Replies)
Discussion started by: Ann
3 Replies

3. UNIX for Advanced & Expert Users

vmstats interpreting

We are having performance issues on an alpha4100 server. I can't paste a snapshot of my vmstat in here, but... We have 4gb of memory. The actual memory stays consistant around 306k. Free is dropping into the 120 area. Wire is around 206k consistantly. consistantly. My manual says that unix... (3 Replies)
Discussion started by: MizzGail
3 Replies

4. Solaris

solaris way if interpreting devices?

Hi all, I wanted to know the solaris way of interpreting devices? I mean i understand all those c0t0....stuff but when i start mounting devices , most of the times i get either a I/O error or it says that the directory does not exist. eg: I have a external usb hub to which i have connected... (1 Reply)
Discussion started by: wrapster
1 Replies

5. UNIX for Dummies Questions & Answers

interpreting netstat output

hi all, when I run- wcars1j5#netstat -an | grep 8090 127.0.0.1.8090 *.* 0 0 49152 0 LISTEN wcars1j5# 1. does this mean that no one is connected to this port? Regards, akash (1 Reply)
Discussion started by: akash_mahakode
1 Replies

6. Solaris

Interpreting xntpdc output.

Hi. I wonder what the equal sign in front of the answer means. I have read man pages and googled but found no answer. xntpdc -p =15.5.64.3 15.5.2.51 3 512 377 0.02060 0.057426 0.04965Thanks. Jan (1 Reply)
Discussion started by: vettec3
1 Replies

7. Shell Programming and Scripting

Interpreting multiple values from a variable

Hi, I am writing a shell script which will check the status of a resource in a cluster and then display nicely to a user running the script at command line. Basically the script runs a status command and then pulls certain keywords from the return and then should display a concise status. ... (5 Replies)
Discussion started by: chris01010
5 Replies

8. UNIX for Dummies Questions & Answers

Help interpreting this freemem/freeswap graph

Hi, I am sure some gurus will recognize what this graph is. This is provided by our SA but I can't understand his explanation. I am not sure if this is from kSar or Cacti. The link that I was given to is to a kSar directory so I am assuming this output is from kSar. Hopefully, I can get a... (1 Reply)
Discussion started by: newbie_01
1 Replies

9. Shell Programming and Scripting

New to Shell Scripting: Need help interpreting example function

In this example function below, I cannot figure out what certain parts mean. if ! echo $PATHwhat is "if !"? (^|:)$1($|:) What is ^|: and$|:? pathmunge () { if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then if ; then PATH=$PATH:$1 else... (3 Replies)
Discussion started by: MemberName
3 Replies
CURLINFO_RESPONSE_CODE(3)				     curl_easy_getinfo options					 CURLINFO_RESPONSE_CODE(3)

NAME
CURLINFO_RESPONSE_CODE - get the last response code SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RESPONSE_CODE, long *codep); DESCRIPTION
Pass a pointer to a long to receive the last received HTTP, FTP or SMTP response code. This option was previously known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier. The stored value will be zero if no server response code has been received. Note that a proxy's CONNECT response should be read with CURLINFO_HTTP_CONNECTCODE(3) and not this. Support for SMTP responses added in 7.25.0. PROTOCOLS
HTTP, FTP and SMTP EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); res = curl_easy_perform(curl); if(res == CURLE_OK) { long response_code; curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code); } curl_easy_cleanup(curl); } AVAILABILITY
Added in 7.10.8. CURLINFO_HTTP_CODE was added in 7.4.1. RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
curl_easy_getinfo(3), curl_easy_setopt(3), CURLINFO_HTTP_CONNECTCODE(3), libcurl 7.54.0 February 03, 2016 CURLINFO_RESPONSE_CODE(3)
All times are GMT -4. The time now is 12:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy