Hi,
I have a really, what I hope is, simple question.
I'm looking for a simple way to see whether a file exists or not and then perform an action based on whether it exists or not. An example of what I tried is as follows:
if
then {
echo "File mysql exists"
... (1 Reply)
Im trying to make a very simple find the first file with the .zip extension in a specific folder and open that file.
The folder path and file name will vary every-time and it may contain spaces. If I try to look
For this example the folder directory is /Users/username/Desktop/testfolder/abc... (6 Replies)
Hi,
I would like to create a script so that it will ask me the following:
1) What is the ip address?
2) What is the gateway address?
3) What is the hostname?
and then put the answer to the below kickstart file (kickstart.cfg)
Here I included the kickstart.cfg:
# Kickstart file... (9 Replies)
I'm trying to run a script file with multiple commands that I would normally type into the command line. The commands are:
#!/bin/bash
diff Test1.o0 /usr3/ronelso4/Desktop/verificationKPC/Test1.o0 > differences2
diff Test1a.o0 /usr3/ronelso4/Desktop/verificationKPC/Test1a.o0 >> differences2... (1 Reply)
I use Rsync to copy files to a remote folder in a command like this
rsync -aNPHAXxrvh --protect-args --fileflags --force-change --delete $file user@remotehost:/Volumes/backup
That works great with passwordless key exchange ;)
Now I'm trying to open a remote file using this command
ssh -q... (5 Replies)
Hi,
I have a log file containing data on emails sent. Looks a bit like this for one email:
Content-Type: text/plain;
charset="UTF-8"
Date: 12 Jun 2008 14:04:59 +0100
From: from@email.com
Subject: xcf4564xzcv
To: recip@email.co.uk
Size = 364 Jun 12 14:04 smtp_234sldfh.tmp
I need to... (5 Replies)
Hello all!
This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician.
Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix:
... (16 Replies)
This is the problem: Write a script that will make a backup of a file giving it a ‘.bak’ extension & verify that it works. I have tried a number of different scripts that haven't worked and I haven't seen anything really concise and to the point via google. For brevity's sake this is one of the... (4 Replies)
Hello guys, im new to to unix/linux
i have a text file like this:
person1@test.com iisiiasasas
person2@test.com 123w2 3233
sajsja person3@test.com jsajjsa
sajsjasaj person4@test.com
I want to extract only e-mail address and get rid of all other stuff, i want an output like this
... (4 Replies)
We have the data looks like below in a log file.
I want to generat files based on the string between two hash(#) symbol like below
Source:
#ext1#test1.tale2 drop
#ext1#test11.tale21 drop
#ext1#test123.tale21 drop
#ext2#test1.tale21 drop
#ext2#test12.tale21 drop
#ext3#test11.tale21 drop... (5 Replies)
Discussion started by: Sanjeev G
5 Replies
LEARN ABOUT OSX
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 <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.2 2009-11-23 Test::Script(3)