Maybe this example helps use to make comparing little easier in shell. You can add breaks as you like.
(( ( DEPT != 888 ) && ( DEPT !=0 ) )) && flag="CLASS"
is same as
Hi Guys,
I want to use if conition for my script. Before I used it tried it with some small test scripts. But it was not succeeded. My script and screen output as follows,
Script:
echo 'Do you think Yes or No (y/n) : '
read ans
echo You input anser as $ans
ans1=y
if ( $ans == $ans1... (5 Replies)
hi, :)
pls consider the following if statement
if //g') ]
then
........
else
.......
when i execute the script i am getting the following error
'(' unexpected
I am not able to find the mistake.
could anybody tell where i did mistake.
cheers
RRK (13 Replies)
hi,
actully i need the belp for the below.
host_list=" Host1 host2 host3 host4 "
n=`hostname`
i need to put the condition like the below
if n is among the host mention in the host_list if
then
#some stugg
else
# some other stuff
fi (1 Reply)
Hi ,
I am trying the following simple script . But it is always giving 1 output. Dont know why
#!/bin/sh
find . -name "a.log"
if ; then
echo "1"
else
echo "0"
fi
Kindly advice. it is giving 1 output even when the a.log file is not there (26 Replies)
a=rhino
b=crocodil
c=testsc
if && "$c" = testsc ]
then
echo "Test #5 succeeds."
else
echo "Test #5 fails."
fi
i need to test or condition before check the output with AND condition. ur help is much appreciated... (11 Replies)
Hi all,
I have task to delete two different files from all file system. one is core file & other is old file.
i can delete core file but for old file i have to mv in different location.
i wrote a script but it is not working.
i have a two variables in this script first one is delcnt &... (6 Replies)
Hi,
I need to use if condition for search a file pattern on a particular location.
cd $file_Path
if ||
then
do this
else
do that
fi
Can someone help me with the if part, how i can put those conditions?
make sure format should be *.file* and *.file
file is a keyword which i... (5 Replies)
Hi i am writing a script where i am running , 5 scripts together in 1 script .
Now what i want is when these 5 scripts run completely , i should execute some other commands like i have compile the data etc.
I have have 5 echo statements at the end of all those scripts .
Like echo "1 is done" in... (1 Reply)
Hi All,
I am using below if condition to check whether null is passed as a parameter to the program
if or ;
then
echo "ABC">>$FILE
else
echo "CDF">>$FILE
fi
However it is saying me null=null command not found . Please help me with this (9 Replies)
Discussion started by: Hypesslearner
9 Replies
LEARN ABOUT DEBIAN
stag-db
STAG-DB(1p) User Contributed Perl Documentation STAG-DB(1p)NAME
stag-db - persistent storage and retrieval for stag data (xml, sxpr, itext)
SYNOPSIS
stag-db -r person -k social_security_no -i ./person-idx myrecords.xml
stag-db -i ./person-idx -q 999-9999-9999 -q 888-8888-8888
DESCRIPTION
Builds a simple file-based database for persistent storage and retrieval of nodes from a stag compatible document.
Imagine you have a very large file of data, in a stag compatible format such as XML. You want to index all the elements of type person;
each person can be uniquely identified by social_security_no, which is a direct subnode of person
The first thing to do is to build an index file, which will be stored in your current directory:
stag-db -r person -k social_security_no -i ./person-idx myrecords.xml
You can then use the index "person-idx" to retrieve person nodes by their social security number
stag-db -i ./person-idx -q 999-9999-9999 > some-person.xml
You can export using different stag formats
stag-db -i ./person-idx -q 999-9999-9999 -w sxpr > some-person.xml
You can retrieve multiple nodes (although these need to be rooted to make a valid file)
stag-db -i ./person-idx -q 999-9999-9999 -q 888-8888-8888 -top personset
Or you can use a list of IDs from a file (newline delimited)
stag-db -i ./person-idx -qf my_ss_nmbrs.txt -top personset
ARGUMENTS
-i INDEXFILE
This file will be used as the persistent index for storage/retrieval
-r RELATION-NAME
This is the name of the stag node (XML element) that will be stored in the index; for example, with the XML below you may want to use the
node name person and the unique key id
<person_set>
<person>
<id>...</id>
</person>
<person>
<id>...</id>
</person>
...
</person_set>
This flag should only be used when you want to store data
-k UNIQUE-KEY
This node will be used as the unique/primary key for the data
This node should be nested directly below the node that is being stored in the index - if it is more that one below, specify a path
This flag should only be used when you want to store data
-u UNIQUE-KEY
Synonym for -k
-p PARSER
This can be the name of a stag supported format (xml, sxpr, itext) - XML is assumed by default
It can also be a module name - this module is used to parse the input file into a stag stream; see Data::Stag::BaseGenerator for details on
writing your own parsers/event generators
This flag should only be used when you want to store data
-q QUERY-ID
Fetches the relation/node with unique key value equal to query-id
Multiple arguments can be passed by specifying -q multple times
This flag should only be used when you want to query data
-top NODE-NAME
If this is specified in conjunction with -q or -qf then all the query result nodes will be nested inside a node with this name (ie this
provides a root for the resulting document tree)
-qf QUERY-FILE
This is a file of newline-seperated IDs; this is useful for querying the index in batch
-keys
This will write a list of all primary keys in the index
-w WRITER
This format will be used to write the data; can be any stag format (xml, sxpr, itext) - default XML.
Can also be a module that catches the incoming stag event stream and does something with it (for example, this could be a module you write
yourself that transforms the stag events into HTML)
SEE ALSO
Data::Stag
For more complex stag to database mapping, see DBIx::DBStag and the scripts
stag-storenode
selectall_xml
perl v5.10.0 2008-12-23 STAG-DB(1p)