03-27-2002
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there,,
how to check if directory/file exist using c/c++ under unix/linux? I can use access() under Window MFC. Thanks.
Steven (1 Reply)
Discussion started by: steven88
1 Replies
2. Programming
Hi there,
how to check if directory/file exist using c/c++ under linux/unix. Thanks.
Steven (2 Replies)
Discussion started by: steven88
2 Replies
3. Shell Programming and Scripting
Hello,
I want to check if some word exist or not on some file
By Example :
word is : nixcraft
file called : /root/shell.txt
and i want to check if nixcraft word exist on /root/shell.txt file with if statement or another tool
Any Ideas (5 Replies)
Discussion started by: LinuxCommandos
5 Replies
4. Shell Programming and Scripting
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)
Discussion started by: gksenthilkumar
3 Replies
5. Shell Programming and Scripting
I have created two scripts, one with hardcoded and another one with extract from file instead of hardcoded,
script:1
--------
#!/bin/ksh
filename="$one/file1.dat"
if
then
echo "$filename has arrived." >> $logfile
else
echo "$filename has NOT yet arrived." >> $logfile
fi
:>
Result:... (4 Replies)
Discussion started by: gksenthilkumar
4 Replies
6. Shell Programming and Scripting
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)
Discussion started by: palak08
1 Replies
7. Shell Programming and Scripting
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)
Discussion started by: palak08
4 Replies
8. Shell Programming and Scripting
HI folks,
can any one tell me how to check whether the file is existed in a directory or not .
let me tell you my requirement : if the file is existed i should display a one message or else i have to send a mail ..
i have the mail logic .. but I'm failed to check file existence .. please... (5 Replies)
Discussion started by: sravan008
5 Replies
9. Shell Programming and Scripting
Hi ,
I have a scripts which run at every 1 min and do some job.
this scripts look for the file in the directory and move in the other directory.
I want to write a line which forst check if the *.LOG file exist in the directory
if *.LOG exist
then
do for i in *.LOG
load
... (7 Replies)
Discussion started by: guddu_12
7 Replies
10. Shell Programming and Scripting
Hi,
I've a situation where i need to check for the file existence and create a zero byte file based on the parameter,in some cases i need to touch and in some case i dont need to touch with zero byte file please help me on parameterizing this touch command??
Regards.
San (2 Replies)
Discussion started by: sandeep karna
2 Replies
FGADM(8) System Manager's Manual FGADM(8)
NAME
fgadm - filtergen command program
SYNOPSIS
fgadm [ check | reload | save | stop ]
DESCRIPTION
fgadm is a simple command interface for managing filtergen(8) based packet filters.
USAGE
fgadm can be used to stop existing filters (thus turning them off), reload new packet filters, save currently running filters for
longevity, and to check filter scripts for errors before reloading.
The following commands are accepted by fgadm:
check Check the filter script /etc/filtergen/rules.filter for errors. The generated filter will be printed on standard output, and errors
printed to standard error.
reload Replace the current live packet filter with the one in /etc/filtergen/rules.filter. The script will be tested for errors before
reloading.
save The current live packet filter will be saved in a distribution-friendly way. On Red Hat systems, this will save the iptables or
ipchains firewall that is currently loaded into the kernel to load at boot with the iptables or ipchains initscript.
stop This command will flush the current live packet filter out and put it in a default accept mode, thus no firewalling will be in
place. This is useful to abort firewalls in an emergency.
EXAMPLES
One may find the following sequence of commands useful for making firewall changes on live servers:
# at now + 2 min
warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh
at> fgadm stop
at> ^D<EOT>
job 53 at 2004-06-07 17:25
# fgadm check
# fgadm reload
# atq
53
# atrm 53
# fgadm save
FILES
/etc/filtergen/rules.filter
Packet filter descriptions are read from this file when fgadm is used.
/etc/filtergen/fgadm.conf
This file alters the behaviour of filtergen as called from fgadm.
BUGS
fgadm save does not work on Debian systems with iptables due to a lack of common sense in the iptables package.
SEE ALSO
filtergen(8), filter_syntax(5), filter_backends(5)
AUTHOR
fgadm was written by Jamie Wilkinson <jaq@spacepants.org> for the filtergen package, to ease maintenance of filtergen-based firewalls.
June 7, 2004 FGADM(8)