10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
As part of a bash the below line strips off a numerical prefix from directory 1 to search for in directory 2.
for file in /home/cmccabe/Desktop/comparison/missing/*.txt
do
file1=${file##*/} # Strip off directory
getprefix=${file1%%_*.txt}
... (5 Replies)
Discussion started by: cmccabe
5 Replies
2. Shell Programming and Scripting
Data files coming in different names in a file name called process.txt.
1. shipments_yyyymmdd.gz
2 Order_yyyymmdd.gz
3. Invoice_yyyymmdd.gz
4. globalorder_yyyymmdd.gz
The process needs to discard all the below files and only process two of the 4 file names available
... (1 Reply)
Discussion started by: dsravanam
1 Replies
3. Shell Programming and Scripting
HI Guys,
I have some 8 files with different name and extensions. I need to check if they are present in a specific folder or not and also want that script to show me which all are not present. I can write if condition for each file but from a developer perspective , i feel that is not a good... (3 Replies)
Discussion started by: shankarpanda003
3 Replies
4. Shell Programming and Scripting
Hi,
I have a files in a directory as below :-
ls -1
mqdepth-S1STC02
proc-mq-S1STC01
proc-mq-S1STC02
proc-mq-S1STC03
Whereever i have S1STC i need to copy them into new file with file name S2STC.
expected output :-
ls -1
mqdepth-S2STC02
proc-mq-S2STC01
proc-mq-S2STC02... (3 Replies)
Discussion started by: satishmallidi
3 Replies
5. Shell Programming and Scripting
Hi All,
I am facing a problem while using SED in Linux.
I have a property file which contains a string
local.mds.dir=${basedir}/deployCompositesIt has be to replaced with another string, and value of that string should be initialized at runtime. So I use placeholder there. My substituted... (2 Replies)
Discussion started by: bhaskar_m
2 Replies
6. Shell Programming and Scripting
Hi,
As a newbie, I'm desperate ro make my shell script work. I'd like a script which checks all the files in a directory, check the file name, if the file name ends with "extracted", store it in a variable, if it has a suffix of ".roi" stores in another variable. I'm going to use these two... (3 Replies)
Discussion started by: armando110
3 Replies
7. Shell Programming and Scripting
Hi all,
I'm pretty new to Shell scripting and I need some help to split a source text file into multiple files. The source has a row with pattern where the file needs to be split, and the pattern row also contains the file name of the destination for that specific piece. Here is an example:
... (2 Replies)
Discussion started by: cul8er
2 Replies
8. Shell Programming and Scripting
Hi,
I have a data file xyz.dat similar to the one given below,
2345|98|809||x|969|0
2345|98|809||y|0|537
2345|97|809||x|544|0
2345|97|809||y|0|651
9685|98|809||x|321|0
9685|98|809||y|0|357
9685|98|709||x|687|0
9685|98|709||y|0|234
2315|98|809||x|564|0
2315|98|809||y|0|537... (2 Replies)
Discussion started by: nithins007
2 Replies
9. Shell Programming and Scripting
Sun Solaris Unix Question
Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
Discussion started by: 2reperry
2 Replies
10. Shell Programming and Scripting
Hi
How can i dynamically read files names from a list file and execute them from a single shell script.
Please help its urgent
Thanks in Advance (4 Replies)
Discussion started by: anushilrai
4 Replies
SVN::Web::X(3pm) User Contributed Perl Documentation SVN::Web::X(3pm)
NAME
SVN::Web::X - exceptions for SVN::Web
SYNOPSIS
use SVN::Web::X;
...
SVN::Web::X->throw(error => '(error message %1)',
vars => [$var_to_interpolate]);
DESCRIPTION
SVN::Web::X implements exceptions for SVN::Web. Derived from Exception::Class, It provides a simple mechanism for throwing exceptions,
catching them, and ensuring that friendly, localised error messages are generated and sent to the user's browser.
USAGE IN SVN
::Web ACTIONS
If an SVN::Web action that you are writing needs to stop processing and raise an error, throw an SVN::Web::X exception.
"throw()" takes a hash with two mandatory keys.
"error"
A string describing the error. This string should be short, and key to a longer internationalised message.
This string may contain placeholders; %1, %2, %3, and so on. These will be replaced by the values of the variables passed in the
"vars" key.
By convention this string should be enclosed in parentheses, "(" and ")". This helps make them stand out in the interface, if
localised versions of the error message have not yet been written.
"vars"
An array reference. The first entry in the array will replace the %1 placeholder in "error", the second entry will replace the %2
placeholder, and so on.
If there are no placeholders then pass a reference to an empty array.
EXAMPLES
A simple exception, with no placeholders.
In the action:
sub run {
...
if(! frob_repo()) {
SVN::Web::X->throw(error => '(frob failed)',
vars => []);
}
...
}
In the en.po file for the localised text.
msgid "(frob failed)"
msgstr "There was a problem trying to frob the repository. This "
"probably indicates a permissions problem."
An exception with placeholders
In the action:
sub run {
...
# $path is a repo path, $rev is a repo revision
my $root = $fs->revision_root($rev);
my $kind = $root->check_path($path);
if($kind == $SVN::Node::none) {
SVN::Web::X->throw(error => '(path %1 does not exist in rev %2)',
vars => [$path, $rev]);
}
}
In the en.po file for the localised text.
msgid "(path %1 does not exist in rev %2)"
msgstr "The path <tt>%1</tt> could not be found in the repository "
"at revision %2. This may be a typo in the path or the revision "
"number. SVN::Web should never normally generate a link like this. "
"If you followed a link from SVN::Web (rather than from an e-mail,
"or similar) please report this as a bug."
As you can see, the localised text can be much friendlier and more informative to the user than the error message.
COPYRIGHT
Copyright 2003-2004 by Chia-liang Kao "<clkao@clkao.org>".
Copyright 2005-2007 by Nik Clayton "<nik@FreeBSD.org>".
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html>
perl v5.14.2 2012-06-11 SVN::Web::X(3pm)