My syntax for the while loop that checked STATE was bad. In bash, you have to use -a instead of &&:
Code:
while [ "$STATE" != "MI" -a "$STATE" != "OH" -a "$STATE" != "IL" -a "$STATE" != "IN" ];do
echo "Sorry, that's not an accepted state."
echo "Enter State: "; read STATE
done
And for some reason, my bash won't recognize the let command... so I have to use expr instead for a counter:
Code:
COUNT=0
while [ "$COUNT" -le "5" ]; do
echo "Count is less than 5."
COUNT=`expr $COUNT + 1`
done
The wonders of a good night's sleep.....
Last edited by nickzourdos; 11-24-2011 at 01:03 PM..
Hi all, I'm confused about the proper syntax for multi-conditional if then statements. I'm trying to set limitations on info input on the command line.. i.e.
if ] ;then
$x=$vr1
else
print "You have entered an invalid option."
Can someone please clue me in on what is wrong with my syntax;... (3 Replies)
I want to do multiple comparisons on a series of numbers from an array:
I send the numbers in file1 through want to print out some info from file2 based on some conditions.
The syntax just isn't correct???
awk '
NR==FNR{
a=$0
next
... (2 Replies)
Please help me. I have been doing this for several hours.
Here is the code
if then
echo a b c d >> file.txt
echo 1111 >> file.txt
fi
The reason I want the two echo is because I want these statements printed on multiple lines. I keep getting error .
First it tells me... (2 Replies)
Hi,
Hav automated a process, and it is working fine.
for first process alone
status = ` ps -ef |grep a `
if
then
echo " Success" > temp/logfile
else
echo " Failure" > temp/logfile
fi
Now I hav to write script to automated some 2 process and then send mail using cron..
... (5 Replies)
how can we execute multiple statements in
else condition
i have
if
then
statement
else
statements
fi
in else condition i have multiple statements
but it executing only one statement
is there any way to execute multiple statements (4 Replies)
Hi ,
I have a peculiar problem.
i have an if block like this
if ;
then
echo " todays date is " ${date} >> log_file
echo " file count is " $ count >> log_file
mv filename1 filename 2
else
echo "no files available ">> log_file
fi
the echo statement "no files available " is not... (2 Replies)
Hi All,
I need to check for 3 conditions and if all the 3 are not satified need to say that services are not running....
is the below code correct.
#********** Check to see if Service 1 is still running**************
if
then
echo "$datetimestamp: Service1 is not running" >>... (4 Replies)
Hi everyone,
May you help me with the correct syntax of the follow bash statements please
X=10
if ]; then
echo "The value is between 1 and 5"
for ((i=1;i<=${X})); do
echo $i
done
else if ]; then
echo "The value is between 6 and 10"
for ((i=1;i<=${X})); do
... (5 Replies)
exmaple:
file1 and file2 has 1 bit
if
then
exit
else
send out email
fi
if
then
exit
else
send out email
fi
it exits the 1st if. did not continue with my 2nd if. thanks in advanced.
Please use CODE tags are suggested on every page when you post an item in... (7 Replies)
Hello,
I am new to scripting and I am trying to write a simple script that creates users and adds their passwords from two files; one a user list file and another a password list file.
For example, I have two files already.
$ cat file1
andy
stephane
aby
paul
$ cat file2
123
234... (4 Replies)
Discussion started by: FemoTheDon
4 Replies
LEARN ABOUT DEBIAN
latexml::bib
LaTeXML::Bib(3pm) User Contributed Perl Documentation LaTeXML::Bib(3pm)NAME
"LaTeXML::Bib" - implements a BibTeX parser for LaTeXML.
DESCRIPTION
"LaTeXML::Bib" serves as a low-level parser of BibTeX database files. It parses and stores a "LaTeXML::Bib::BibEntry" for each entry into
the current STATE. BibTeX "string" macros are substituted into the field values, but no other processing of the data is done. See
"LaTeXML::Package::BibTeX.pool.ltxml" for how further processing is carried out, and can be customized.
Creating a Bib
"my $bib = LaTeXML::Bib->newFromFile($bibname);"
Creates a "LaTeXML::Bib" object representing a bibliography from a BibTeX database file.
"my $bib = LaTeXML::Bib->newFromString($string);"
Creates a "LaTeXML::Bib" object representing a bibliography from a string containing the BibTeX data.
Methods
"$string = $bib->toTeX;"
Returns a string containing the TeX code to be digested by a LaTeXML object to process the bibliography. The string contains all
@PREAMBLE data and invocations of "\ProcessBibTeXEntry{$key}" for each bibliographic entry. The $key can be used to lookup the data
from $STATE as "LookupValue('BIBITEM@'.$key)". See "BibTeX.pool" for how the processing is carried out.
BibEntry objects
The representation of a BibTeX entry.
"$type = $bibentry->getType;"
Returns a string naming the entry type of the entry (No aliasing is done here).
"$key = $bibentry->getKey;"
Returns the bibliographic key for the entry.
"@fields = $bibentry->getFields;"
Returns a list of pairs "[$name,$value]" representing all fields, in the order defined, for the entry. Both the $name and $value are
strings. Field names may be repeated, if they are in the bibliography.
"$value = $bibentry->getField($name);"
Returns the value (or "undef") associated with the the given field name. If the field was repeated in the bibliography, only the last
one is returned.
AUTHOR
Bruce Miller <bruce.miller@nist.gov>
COPYRIGHT
Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.
perl v5.10.1 2009-06-11 LaTeXML::Bib(3pm)