hi,
i want to write the script to list atleast one file inside that directory
eg:
/home/Log/amp01
/home/log/amp02
.
.
.
/home/log/amp..N
want to see atleast one file inside the /home/log/amp01 .... amp(N)
if it not there.. need to give that no file exists inside... (3 Replies)
Question for anyone that might be able to help:
My objective is to eheck if a file (a source file) exists in a directory. If it does then, I'd like to call an application (Informatica ETL file...not necessary to know) to run a program which extracts data and loads it into multiple targets.
... (6 Replies)
Hi,
Here is what i'm trying to do,
-Check in two directories for a user inputed filename
-Then cat all the version found of the file to the current screen
I am a total nembie to programming, here what i have done so far....
#!/bin/bash
#Check in /home/loonatic and /var/named/master... (2 Replies)
Hi,
I am new to shell scripting.Please help me on this.I am using solaris 10 OS and shell i am using is
# echo $0
-sh
My requirement is i have source file say makefile.I need to extract files with extensions (.c |.cxx |.h |.hxx |.sc) from the makefile.after doing so i need to check whether... (13 Replies)
Dear members, The following expect script connects to remote node and check for the file "authorized_keys" in directory /root/.ssh in remote node. However the result is always found even if the file exist or doesn't exist.
expect {
"$fname" {
send_user "found\n"
}
Any idea what is... (4 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Write a script checkFiles.sh that takes an arbitrary number of file paths from the command line and carries ... (5 Replies)
I am passing multiple files in awk & since one of the file is empty(say file3) so the same gets skipped & logic goes for toss. Need suggestion/help in checking and putting additional checks for the same
awk -F, 'FNR==1 {++filecounter}
filecounter==1 {KRL=$2;next}
filecounter==2... (8 Replies)
Hello,
I needed help with a shell script where in it checks if a file exists under a directory and also checks the age of the file and delete it if it is older than 3 weeks.
thanks (10 Replies)
hello everyone,
I am new to linux and got this deliverable to write a script that should check for error in multiple log file (count is approx 2500 log files on single server) and once error is found, it should mail that error
My logic says:
we can put all log files path/location in one... (2 Replies)
Hi All,
I am new in scripting and working in a project where we have RSyslog servers over CentOS v7 and more than 200 network devices are sending logs to each RSyslog servers. For each network devices individual folders create on the name of the each network devices IP addresses.The main... (7 Replies)
Discussion started by: Pinaki
7 Replies
LEARN ABOUT CENTOS
test::script
Test::Script(3) User Contributed Perl Documentation Test::Script(3)NAME
Test::Script - Basic cross-platform tests for scripts
DESCRIPTION
The intent of this module is to provide a series of basic tests for 80% of the testing you will need to do for scripts in the script (or
bin as is also commonly used) paths of your Perl distribution.
Further, it aims to provide this functionality with perfect platform-compatibility, and in a way that is as unobtrusive as possible.
That is, if the program works on a platform, then Test::Script should always work on that platform as well. Anything less than 100% is
considered unacceptable.
In doing so, it is hoped that Test::Script can become a module that you can safely make a dependency of all your modules, without risking
that your module won't on some platform because of the dependency.
Where a clash exists between wanting more functionality and maintaining platform safety, this module will err on the side of platform
safety.
FUNCTIONS
script_compiles
script_compiles( 'script/foo.pl', 'Main script compiles' );
The "script_compiles" test calls the script with "perl -c script.pl", and checks that it returns without error.
The path it should be passed is a relative unix-format script name. This will be localised when running "perl -c" and if the test fails the
local name used will be shown in the diagnostic output.
Note also that the test will be run with the same perl interpreter that is running the test script (and not with the default system perl).
This will also be shown in the diagnostic output on failure.
script_runs
script_runs( 'script/foo.pl', 'Main script runs' );
The "script_runs" test executes the script with "perl script.pl" and checks that it returns success.
The path it should be passed is a relative unix-format script name. This will be localised when running "perl -c" and if the test fails the
local name used will be shown in the diagnostic output.
The test will be run with the same perl interpreter that is running the test script (and not with the default system perl). This will also
be shown in the diagnostic output on failure.
SUPPORT
All bugs should be filed via the bug tracker at
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Script>
For other issues, or commercial enhancement and support, contact the author.
AUTHOR
Adam Kennedy <adamk@cpan.org>
SEE ALSO
prove, <http://ali.as/>
COPYRIGHT
Copyright 2006 - 2009 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.16.3 2009-11-24 Test::Script(3)