I want to check if some directories with common prefix exist under current directory with bash, say, I have dictories like:
in the current directory. I did:
However, it returns me:
Then I tried to count the lines of ls output with:
However, as I do not have the /dev/null in my ubuntu 10.04 system. I can not send the line
to the null. So if there is no dirct* directory existing, there will be a trouble.
say i would like to check if the file is existed before i use rm command. How can i do it?
i know if i can use find, but i would like to have a good interface (in a shell script)
thks (3 Replies)
I have the below script to check whether directory is exist or not , now I sure the directory /abc NOT exist , but when run the script , it still pop the result is "the directory exist" , could suggest what is wrong ? thx
ll -d /abc > /dev/null 2>&1
if
then
echo "the directory exist !!"
... (7 Replies)
Hi
Does anybody know how I can check if a file exists
i.e. see bellow, this doesn't work by the way and if tried countless variations on this
file1=$one/file111.txt
if
then
echo "Present"
else
echo "Not present"
fi
result :
Not present
(file is already present, eventhough its... (3 Replies)
Hi ,
I 'm trying to check if multiple directories exist on a server, if not create the missing ones and print " creating missing directory.
how to write this in a simple script, I have made my code complex
if ; then
taskStatus="Schema extract directory exists, checking if SQL,Count and... (7 Replies)
Hi,
I am trying to create a bash script which will check if file exist then remove that file else do nothing. I have to do same process for three files in same script. I have written code for one file and trying to run it.
if
then
rm -r /user1/abc/File1
fi
When I run this code it... (1 Reply)
Hi,
I created following script to check if file exist:
#!/bin/bash
SrcDir=$1
SrcFileName=$2
SrcTimePeriod=$3
if ;then
echo 1
else
echo 0
fi
I ran it like: /apps/Scripts/FileExist.sh /apps/Inbox file1 2nd_period_2010
Even file exist at that location, my above command is... (4 Replies)
Hello
Im trying to build a script that (among other stuff) checks each line in a file for the $4 "variabel" and if there are a folder in the directory that has that not has the same name as that it create a folder, otherwise it wont do anything. I guess i could just send the errors to /dev/null,... (2 Replies)
Hi,
I am new to shell-scripting, and doing a lot of reading. I am having some trouble getting started with a simple testing of scripting. I have been experimenting with if, loops, for, test, etc., but still unsure. I seem to have the hang of it when it comes to creating a single file or... (6 Replies)
How to execute multiple files in multiple folders and also output to be generated in the same folder?
Hello Team,
I have a path like Sanity_test/*/* and it has around 100+ folders inside with files. I would like to run/execute those files and output of execution to be placed on same /... (1 Reply)
Hi All,
Whenever i get 10 files(file names like sales*) then another file need to create.
May i know how to implement this in KSH. (4 Replies)
Discussion started by: siddireddy
4 Replies
LEARN ABOUT DEBIAN
naturaldocs
NATURALDOCS(1) General Commands Manual NATURALDOCS(1)NAME
NaturalDocs - an extensible, multi-language documentation generator
SYNOPSIS
naturaldocs -i <input (source) directory> [-i <input (source) directory> ...] -o <output format> <output directory> [-o <output format>
<output directory> ...] -p <project directory> [options]
DESCRIPTION
This manual page documents briefly the .B naturaldocs command. Note that naturaldocs is a wrapper script that on Debian invokes the real
NaturalDocs perl program. So, the real, original name of the program is NaturalDocs but on Debian systems you invoke it as naturaldocs.
Natural Docs is is an open-source, extensible, multi-language documentation generator. You document your code in a natural syntax that
reads like plain English. Natural Docs then scans your code and builds high-quality HTML documentation from it.
OPTIONS
A summary of options, extracted from the help printed by the -h switch is included below. For a complete description of how NaturalDocs
works, see the text files in the /usr/share/doc/naturaldocs directory.
Required parameters:
-i, --input, --source DIR
Specifies an input (source) directory. Required.
Can be specified multiple times.
-o, --output FMT DIR
Specifies an output format and directory. Required.
Can be specified multiple times, but only once per directory. Possible output formats are HTML and FramedHTML.
-p, --project DIR
Specifies the project directory. Required.
There needs to be a unique project directory for every source directory.
Optional parameters:
-s, --style STYLE [STYLE ...]
Specifies the CSS style when building HTML output. If multiple styles are specified, they will all be included in the order given.
-img, --image DIR
Specifies an image directory. Can be specified multiple times. Start with * to specify a relative directory, as in -img */images.
-do, --documented-only
Specifies only documented code aspects should be included in the output.
-t, --tab-length LEN
Specifies the number of spaces tabs should be expanded to. This only needs to be set if you use tabs in example code and text dia-
grams. Defaults to 4.
-xi, --exclude-input, --exclude-source
Excludes an input (source) directory from the documentation. Automatically done for the project and output directories. Can be spec-
ified multiple times.
-nag, --no-auto-group
Turns off auto-grouping completely.
-oft, --only-file-titles
Source files will only use the file name as the title.
-r, --rebuild
Rebuilds all output and data files from scratch. Does not affect the menu file.
-ro, --rebuild-output
Rebuilds all output files from scratch.
-q, --quiet
Suppresses all non-error output.
-?, -h, --help
Displays syntax reference.
AUTHOR
NaturalDocs was written by Greg Valure <gregvalure@naturaldocs.org>.
This manual page was written by Federico Di Gregorio <fog@debian.org>, for the Debian project (but may be used by others).
May 2007 NATURALDOCS(1)