Sponsored Content
Full Discussion: Help with if condition
Top Forums Shell Programming and Scripting Help with if condition Post 302911862 by nikhil jain on Monday 4th of August 2014 06:48:11 AM
Old 08-04-2014
Code:
set -x
#find /opt/c/Com/depots -name "version.info" > a.txt
 
while read line
do
cat $line > detail.txt
var=`cat detail.txt|awk -F ":" '/PatchNumber/ {print $2}'`
if [ $var == "0" ]
then
echo "stabilization.Build.2013"
else
echo "stabilization.PatchBuild.2013.$var"
fi
done < a.txt

a.txt contains

/a/b/c/v.info
/d/e/f/v.info
...
...

v.info contains

Release : 2014Q1
Branch : stabilization
BuildNumber : 2013
PNumber : 3

but PNumber keeps changing based on v.info file
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

if condition ...

i have following if condition if above statement is case sensitive.....what is syntax if i have to make above comparision case insensetive (4 Replies)
Discussion started by: mahabunta
4 Replies

2. Shell Programming and Scripting

if condition

Hi friends, :) In a shell script i found the following if condition. echo -n "Which version of $1 do you want to restore ('0' to quit)? : " read desired if ${desired:=1} -ge $index ] ; then echo "$0: Restore canceled by user: index value too big." >&2 exit 1 fi Can... (1 Reply)
Discussion started by: ravi raj kumar
1 Replies

3. Shell Programming and Scripting

if..else condition

i have a paramter data_date in which i am passing a string value.i want to find out another paramter file_date from this.the logic is given below if day of data_date = sunday or monday then file_date=data_date-1 else file_date=data_date-2 i am passing data_date as 20061027. how can i... (3 Replies)
Discussion started by: dr46014
3 Replies

4. Shell Programming and Scripting

If Condition

Hi, I am trying to execute this command, but is it not working, says "`;' unexpected" eval $lgrep $SAM_CMD ; if ; then ; echo "No Error" ; fi What i want is, return the command output, if it is non zero, say "No Error". Thanks, John. (21 Replies)
Discussion started by: john_prince
21 Replies

5. Shell Programming and Scripting

or in a IF condition

Hi I have to evaluate multiple conditions with an 'or'. Here is an example: if when i use the above i get a error message ' Please help me to know if i am missing something in the syntax. how do i achieve multiple "or" in the same if condition. Thanks. (11 Replies)
Discussion started by: sunrexstar
11 Replies

6. HP-UX

Difference between [condition] and [[condition]] and ((condition)) when used with if condition

Executed the following if conditions .. and got different results . only (( )) gave correct o/p with all scenarios . Can anybody please let me know what is the difference between and ] and ((condition)) when used with if condition. And why each condition gave different result. 1.... (2 Replies)
Discussion started by: soumyabubun
2 Replies

7. Shell Programming and Scripting

redirect stdout echo command in condition A run in condition B

hi, I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command Here are my simple script After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Discussion started by: jao_madn
3 Replies

8. Shell Programming and Scripting

if condition

if chr1:109457160 1 109457160 99.1735537190083 + chr1:109457233 1 109457233 99.1735537190083 - chr1:109457614 1 109457614 99.1735537190083 + chr1:109457618 1 109457618 100 + chr1:109457943 1 109457943 100 - chr1:109458224 1 109458224 99.1735537190083 - file1.txt If 6th column in... (3 Replies)
Discussion started by: johnkim0806
3 Replies

9. Shell Programming and Scripting

If condition return 0 even when it fails to satisfy te condition

HI My doubt may be basic one but I need to get it clarified.. When i use "if" condition that checks for many AND, OR logical conditions like if ]; then return 0 fi Even the if condition fails it returns as zero.. Any clue.. But if i add else condition like if ]; ... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

10. UNIX for Dummies Questions & Answers

IF [ condition ] help

Hi all Unix newbie - please be gentle Am modifying an existing script to error trap a variable with a length of 0 #!/bin/bash ipfile='/var/data/bin/ipaddress' ] && ipold="$(< "$ipfile" )" ipnew="$( wget -q -O - checkip.dyndns.org | sed -e 's/.*Current IP Address: //;s/<.*$//' )" #... (6 Replies)
Discussion started by: CRChamberlain
6 Replies
c-icap(8)						      System Manager's Manual							 c-icap(8)

NAME
c-icap - ICAP filtering server SYNOPSIS
c-icap [ -f config-file ] [ -N ] [ -d debug-level ] [ -D ] DESCRIPTION
c-icap is an implementation of an ICAP server. It can be used with HTTP proxies that support the ICAP protocol. Most of the comercial HTTP proxies must support ICAP pcotocol. OPTIONS
-f config-file Specify the configuration file -N Do not run as daemon -d level Specify the debug level -D Print debug info to stdout FILES
/etc/c-icap/c-icap.conf The main configuration file /etc/c-icap/c-icap.magic In this file defined the types of files and the groups of file types. /var/run/c-icap.pid By default c-icap writes its pid in this file. The path of this file can changed using the PidFile configuration parameter in the c- icap.conf file /var/run/c-icap.ctl The commands socket. This file used to send commands to the icap server from command line. For information about implemented com- mands look below in the "Implemented commands" sub-section NOTES
Implemented commands Currently the following commands are implemented: stop The c-icap will shutdown reconfigure The service will reread the config file without the need to stop and restart the c-icap server. The services will be reinitialized Services and modules can define their own commands. Examples: To reconfigure c-icap: echo -n "reconfigure" > /var/run/c-icap.ctl Lookup tables Lookup tables are simple read-only databases. A lookup table can defined in c-icap.conf file using the form: type:path where the type is the type of lookup table and path is the extra information required to use the table (e.g. file path). Currently the fol- lowing lookup table types defined internally by c-icap: file Simple text file databases. The database records are stored in text files in the form: key[: value1, value2 ...] example path definition: file:/path/to/the/file.txt hash Similar to file lookup tables but c-icap uses fast hashes for searching. example path definition: hash:/path/to/the/file.txt regex Similar to the file lookup tables but the keys are regular expressions in the form /regex/flags where flags are 'i' to ignore case or nothing. example regex lookup table data: /^[a-m].*/i: group1 /^[n-z].*/i: group2 example path definition: regex:/path/to/the/file.txt Runtime information Someone can retrieve runtime information using the info service. The information includes bytes received and transmited, active services, information about service usage and many other. The information provided in HTML and text format. Example: Retrieve runtime information from command line: c-icap-client -i localhost -s "info?view=text" -req "a_url" SEE ALSO
c-icap-client(8) c-icap-stretch(8) c-icap-config(8) c-icap-libicapapi-config(8) c-icap-mkbdb(8) BUGS
Many... AUTHOR
Tsantilas Christos c_icap 0.1.6 c-icap(8)
All times are GMT -4. The time now is 09:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy