Hey guys im trying to check if the directory exists
i get a syntax error on the elif statement iv tried using else and still same result im not sure. If the directory does not exist can i just insert mkdir /tmp/old under the elif once that part gets working
Hi,
I need to prompt for a response from a user to enter a path
read dest_dir?"Please Enter Directory :"
How do I do this until a valid directory is entered by the user. I can use
to check the existence of the directory. However when I try the following I cannot get it to work.
while ... (2 Replies)
I'm trying to write a script that identifies whether a directory of the form AWL.????????.IP exists. I have one that exists which is AWL.05301032.IP.
When I test like this: If ]
I get true, but when I test like this:
If ]
Or like this
If ]
Or any other variation of wild cards, I... (4 Replies)
Hi.
I what to write a make file that inside a target I want to check if a directory exists.
some like:
### make
a:
if ;then
<command 1>
else
<command 2>
fi
### make end
Thanks a lot
---------------------- (2 Replies)
Hello:
Can someone please help me figure out what is wrong here, my script does not move on to the "else" part even though there is no .ssh directory on my remote server:
$more putkey.sh
#!/bin/ksh
for server in `cat list`
do
if ; then
cat $HOME/.ssh/id_rsa.pub |ssh $server ' cat >>... (4 Replies)
cp $PATHLOGS/$DATE/*.* $TMP/logs_tmp/
cp $PATHLOGS/$DATE1/*.* $TMP/logs_tmp/
Before copying the files I have to check if the directory $DATE1 and $DATE2 exists.
If directory exists then, check if the folder contains some files.
if the file exists then, check if the file size is greater... (3 Replies)
I want to perform SQL *Loader operation only if a file named "load.txt" exists in a directory "/home/loc/etc". Please help how to check this with a if condition. (8 Replies)
Hi,
I am using solaris 10 OS and bash shell.just checking for small code snippet which follows below.
/export/home/vomappservers/spa/common/5.0
/export/home/vomappservers/spa/common/scripts
/export/home/vomappservers/spa/tools
/export/home/vomappservers/spa/scm5.0/SCCS... (5 Replies)
Hi Gurus,
I have a requests to find if all the file in the filelist exist in certain directory.
example:
my filelist
abc
def
ddd
cde
afg
how can I find these 5 files exists at director /home/abc
Thanks in advance (7 Replies)
Hi guys,
I am beginner trying to learn unix. So any help is welcomed.
My requirement is to check whether is a file exists in a particular directory or not.
The directory path and filename are taken dynamically with user interaction. So the program should continue only if the $filename... (1 Reply)
There are some files with suffix dates like abc_20032019.dat abc_17032019.dat
If at least one file exists then perform some operation else exit from execution.
Korn shell
----------------------------------
array=($inputdir/abc*.dat)
If ] ]
then
echo " file exits"
else
echo " file does... (10 Replies)
Discussion started by: Rajesh123
10 Replies
LEARN ABOUT CENTOS
xmlif
XMLIF(1) xmlif XMLIF(1)NAME
xmlif - conditional processing instructions for XML
SYNOPSIS
xmlif [attrib=value...]
DESCRIPTION
xmlif filters XML according to conditionalizing markup. This can be useful for formatting one of several versions of an XML document
depending on conditions passed to the command.
Attribute/value pairs from the command line are matched against the attributes associated with certain processing instructions in the
document. The instructions are <?xmlif if?> and its inverse <?xmlif if not?>, <?xmlif elif?> and its inverse <?xmlif elif not?>, <?xmlif
else?>, and <?xmlif fi?>.
Argument/value pairs given on the command line are checked against the value of corresponding attributes in the conditional processing
instructions. An `attribute match' happens if an attribute occurs in both the command-line arguments and the tag, and the values match. An
`attribute mismatch' happens if an attribute occurs in both the command-line arguments and the tag, but the values do not match.
Spans between <?xmlif if?> or <?xmlif elif?> and the next conditional processing instruction at the same nesting level are passed through
unaltered if there is at least one attribute match and no attribute mismatch; spans between <?xmlif if not?> and <?xmlif elif not?> and the
next conditional processing instruction are passed otherwise. Spans between <?xmlif else?> and the next conditional-processing tag are
passed through only if no previous span at the same level has been passed through. <?xmlif if?> and <?xmlif fi?> (and their `not'
variants) change the current nesting level; <?xmlif else?> and <?xmlif elif?> do not.
All these processing instructions will be removed from the output produced. Aside from the conditionalization, all other input is passed
through untouched; in particular, entity references are not resolved.
Value matching is by string equality, except that "|" in an attribute value is interpreted as an alternation character. Thus, saying
foo='red|blue' on the command line enables conditions red and blue. Saying color='black|white' in a tag matches command-line conditions
color='black' and color='white'.
Here is an example:
Always issue this text.
<?xmlif if condition='html'?>
Issue this text if 'condition=html' is given on the command line.
<?xmlif elif condition='pdf|ps'?>
Issue this text if 'condition=pdf' or 'condition=ps'
is given on the command line.
<?xmlif else?>
Otherwise issue this text.
<?xmlif fi?>
Always issue this text.
AUTHOR
Eric S. Raymond <esr@snark.thyrsus.com>
Author of xmlif program
Linux April 2009 XMLIF(1)