If you want to distinguish between not set and set but empty, have a look at the ${var-value} and ${var:-value} construct.
As long as you are not quoting $path, you don't need to make things conditional, though.. Your code should work already. (On the other hand, you properly ought to put $path in double quotes.)
PS. You are extracting into tarlist.txt, but using tarlist without the .txt. Also the cat | awk is a Useless Use of Cat. Google for that phrase.
Last edited by era; 03-28-2008 at 10:44 AM..
Reason: P.S.
I want to check to see if a variable is set - and if not set it to something
ie. variable name test
I want to check if $test is set
then if there is nothing set against this currently - then set it to 0
Whats the best / shortest way of doing this in a script? (3 Replies)
I need to check if $1 or $2 are empty before continuing but I don't know if bash has any logic of the sort. This is what I'm looking for - except that "and" doesn't seem to work.
if and ;then
...
Thank you! :D (4 Replies)
HI ,
I have to check the values of variable is blank or not.
exm :
###test
test1
var=`cate filename | head -1 | cut -c1-3`
I need to check the first three character of 1st line . if it is blank .then exit or we need to process .
Thanks in advance . (2 Replies)
Hello everyone, I'm trying the best way to implement a check on a variable ... in particular I need to assess the content of characters and numbers , I tried on various manuals bash scripting but I could not figure out how to do ... any help? (3 Replies)
Apologies for the utter triviality of this question, but we all have to start somewhere! I've also tried searching but this question is pretty vague so I didn't (a) really know what to search for or (b) get many relevant hits to what I did search for.
Anyway, I'm in the process of self-teaching... (1 Reply)
Hi!
Been working on a script and I've been having a problem. I've finally narrowed it down to this variable I'm setting:
servername=$(awk -v FS=\/ '{ print $7 } blah.txt | sed 's\/./-/g' | awk -v FS=\- '{print $1}')"
This will essentially pare down a line like this:
... (7 Replies)
Hi,
Will following set up work in bash script? I've got errors if assigning following binary command to a variable. But on the other hand, COMMAND="ls" works. Any explanation please? How can I assign binary command to a variable COMMAND then I can just call ${COMMAND}?
COMMAND="rsync"... (3 Replies)
while i've used arrays to work with variables, i've never used them to loop through a set of strings and wanted to ask the community for some feedback or assistance.
let me be specific. here's my code:
# URL port Variables
port2195=`nc -z $url2195 2195`
port2196=`nc -z $url2196 2196`... (5 Replies)
Hi All
Need Help
I have a file with the below format (ABC.TXT) :
®¿¿ABCDHEJJSJJ|XCBJSKK01|M|7348974982790
HDFLJDKJSKJ|KJALKSD02|M|7378439274898
KJHSAJKHHJJ|LJDSAJKK03|F|9898982039999
(cont......)
I need to write a script where it will check for : blank lines (between rows,before... (6 Replies)
Hi,
I have 4 parameters passed to my shell and i validate if all four are entered using the following snippet:
if
then echo "Not entered"
else echo "entered"
fi
I get the following output as 'Not entered even when i enter the values for all prompts.
Please advise.
Thanks. (5 Replies)
Discussion started by: Jesshelle David
5 Replies
LEARN ABOUT DEBIAN
c-icap
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)