Hi, I need to write a script that changes the name of the filename. Let's say my script is named change_filename and I want to use it on a file named test1.txt. After running the script I want the filename renamed to test1_fails.txt
e.g.
I'm thinking maybe the sed command and to substitute the filename but I don't know how to do it.
Hi,
I have a parameter file and it contains following items
$ cat TransactionParams
From_Date_Parm=2005-02-25
To_Date_Parm=2005-05-25
Extract_Root_Parm=/detld1/etl/ascential/Ascential/DataStage/Projects/CTI_London/IAM
Extract_Type_Parm=Transaction
EDW_Database_Parm=hdw_erks... (1 Reply)
Hi All,
If I want to ftp files from machine to local pc. But the ip must change everytime :( (due to VPN), can I write a script to easiler (no need to update ip in script)?
user_name=aaa
password=bbb
cat ip.txt
#
# FTP the files
#
ftp -d -in 199.200.204.109 <<EOF
user $user_name... (2 Replies)
Hi,
IŽd like to know how to program a shell script for know when a file changes and based on that make another tasks all this in real time.. Thanks (2 Replies)
Hi,
Requirement:-
Need to change pfile,so while executing script,it has to go to pfile location(ORACLE_HOME/dbs) and open init<SID>.ora file and change value db_name=<>.
If db_name=abcd,script will change the db_name=1234 likr that..
Please help to code this (1 Reply)
Hi to all,
Maybe someone could help me. I want to transform the structure of a xml file.
I have this input.xml:
<?xml version="1.0" encoding="utf-8"?>
<votings>
<file name="Reference 19762">
<case id="No. 3 Div. 870">
<j v="1">Peter</j>
<j v="1">Ely</j>
<j... (10 Replies)
hi,
I have a local.conf file which has the first line
TOPDIR = "/home/mvdev/workspace/boxer". I want to replace the value to
"/home/common/workspace/mirror". I tried the following perl command that is
perl -p -i -e 's/Path/path1/g' myfile.txt then
sed... (7 Replies)
Hello all,
I have a line of code in a file that I need to change in the /etc/sysconfig/kdump file
presently the line reads:
KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off"
what I need to do is put a comment out the 1st line and repeat it, and... (5 Replies)
I have a file that contains todays date(for ex- test_08/30/2013)
Now I want a script which will run and change the name of the file and put yesterday's date
(for ex- test_08/29/2013)
Please help.
---------- Post updated at 04:40 AM ---------- Previous update was at 04:31 AM ----------
I... (2 Replies)
I have a landing directory on my unix (solaris) server, that receives the following files:
MLH4301I AAOT-hhslog.610.20150805.txt
MLH4301I AAOT-hhslog.611.20150805.txt
MLH4301I AAOT-hhslog.612.20150805.txt
MLH4301I AAOT-hhslog.613.20150805.txt
and I need to add to this files the number 10000... (6 Replies)
Discussion started by: fretagi
6 Replies
LEARN ABOUT MOJAVE
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.18.2 2009-11-23 Test::Script(3)