09-20-2011
Dear Itkamaraj,
Sorry for not following tags.
The solution that you have given can not be understood by us :-(
Can you please simplify it?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hey
how can i change part of a file
i hve to do in a masses so mv or cp is not practical.
I have to change xxx_rrr to xxx_yyy
pls help
thank (2 Replies)
Discussion started by: ajaya
2 Replies
2. Shell Programming and Scripting
I was using the following code to replace the path names and it works when it is
echo "$PWD/$f" | sed -e 's/^.*chris\.domain\.com/chris.domain.com/'
IN fact it works great
However I tried to incorporate a variable
echo "$PWD/$f" | sed -e... (3 Replies)
Discussion started by: chrchcol
3 Replies
3. Shell Programming and Scripting
Hi Guys,
I am needing some help writing a shell script to replace the following in a text file
/opt/was/apps/was61
with some other path eg
/usr/blan/blah/blah.
I know that i can do it using sed or perl but just having difficulty writing the escape characters for it
All Help... (3 Replies)
Discussion started by: cgilchrist
3 Replies
4. Shell Programming and Scripting
Im new to using perl scripting, and i was wondering if anyone could help me, I need to create a cgi file that when it runs it opens a file looks through all the words, and replace the word hello with goodbye, ive been looking around and someone said to use an If statement, but ive found no other... (2 Replies)
Discussion started by: xzen123
2 Replies
5. Shell Programming and Scripting
Dear all,
In a bash script, I grep a filename from an UTF8 encoded file:
LIST=`grep ^source $FILE | tr "\t" " " | cut -d " " -f 2 | sed -e 's,~,\$HOME,g'`
The result is
# echo $LIST
$HOME/.mail_aliases_seminaire_MMMG
Then I try to access it:
#ls $LIST
ls: cannot access... (3 Replies)
Discussion started by: josce
3 Replies
6. Shell Programming and Scripting
I am following the tread number 81556 to grep a file and send the results in email.
#/bin/bash
/bin/grep -i 'invite sip' /var/log/asterisk/full
if echo "found" |
mail -s 'invite sip' mail@gmail.com
When I just build it to grep and mail, it works fine. However, the if statement causes... (4 Replies)
Discussion started by: klysdale
4 Replies
7. Shell Programming and Scripting
I have file like this
"copy table_name from filea.txt on node replace delimiter '|';"
"copy table_name from fileb.txt on node replace delimiter '|';"
"copy table_name from filec.txt on node replace delimiter'|';"
"copy table_name from filee.txt on node replace delimiter '|';"
"copy... (1 Reply)
Discussion started by: nnani
1 Replies
8. Shell Programming and Scripting
I want get a number(ID) from a sentence which has been grepped from file using error number.
For Example:
#!/bin/ksh
echo "Enter RRS ID: "
read rrs
echo "Enter error number:"
read err
scp -pr ptc-avdbamdw102:/home/icsprd/M3logs/Accurate/logs/corp_post/$rrs.*.err.txt $HOME/daemon_mail/... (7 Replies)
Discussion started by: JayDoshi
7 Replies
9. UNIX for Dummies Questions & Answers
Hi Everyone,
I am a bit new at learning this bash syntax. I have a problem at work that needs to be addressed. We find we are spending quite a bit of time killing old processes created by oracle replication that have been restarted later in the week. Because the replication takes time to... (3 Replies)
Discussion started by: bdby
3 Replies
10. UNIX for Dummies Questions & Answers
We have C shell and we are executing the below script:
#!/bin/csh -f
if ($#argv != 2) then
echo "Usage $0 DirecotryPath Inputfilename"
exit 1
endif
set dir=$1
set fname=$2
echo $dir
foreach line ( `cat $fname` )
echo \ ======================================== >>... (2 Replies)
Discussion started by: donisback
2 Replies
LEARN ABOUT DEBIAN
object::authority
Object::AUTHORITY(3pm) User Contributed Perl Documentation Object::AUTHORITY(3pm)
NAME
Object::AUTHORITY - adds an AUTHORITY method to your class
SYNOPSIS
{
package MyClass;
use Object::AUTHORITY;
BEGIN {
$MyClass::AUTHORITY = 'cpan:TOBYINK';
$MyClass::VERSION = '0.001';
}
}
print MyClass->AUTHORITY . "
"; # prints "cpan:TOBYINK
";
MyClass->AUTHORITY('cpan:FOO'); # assertion fails, croaks.
DESCRIPTION
This module adds an "AUTHORITY" function to your package, which works along the same lines as the "VERSION" function.
The authority of a package can be defined like this:
package MyApp;
BEGIN { $MyApp::AUTHORITY = 'cpan:JOEBLOGGS'; }
The authority should be a URI identifying the person, team, organisation or trained chimp responsible for the release of the package. The
pseudo-URI scheme "cpan:" is the most commonly used identifier.
"AUTHORITY"
Called with no parameters returns the authority of the module.
"AUTHORITY($test)"
If passed a test, will croak if the test fails. The authority is tested against the test using something approximating Perl 5.10's smart
match operator. (Briefly, you can pass a string for "eq" comparison, a regular expression, a code reference to use as a callback, or an
array reference that will be grepped.)
Utility Function
"Object::AUTHORITY::reasonably_smart_match($a, $b)"
Object::AUTHORITY exposes its smart match implementation in case classes wish to reuse it for their own custom "AUTHORITY" methods.
(There are various interesting use cases for custom "AUTHORITY" methods, just as there are for custom "can" and "isa" methods.)
The $a parameter is always assumed to be a simple scalar.
BUGS
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=Object-AUTHORITY <http://rt.cpan.org/Dist/Display.html?Queue=Object-
AUTHORITY>.
SEE ALSO
o Object::AUTHORITY (this module) - an AUTHORITY method for your class
o authority::shared - a more sophisticated AUTHORITY method for your class
o UNIVERSAL::AUTHORITY - an AUTHORITY method for every class (deprecated)
o UNIVERSAL::AUTHORITY::Lexical - an AUTHORITY method for every class, within a lexical scope
o authority - load modules only if they have a particular authority
Background reading: <http://feather.perl6.nl/syn/S11.html>, <http://www.perlmonks.org/?node_id=694377>.
AUTHOR
Toby Inkster <tobyink@cpan.org>.
COPYRIGHT AND LICENCE
This software is copyright (c) 2011 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
perl v5.14.2 2011-12-15 Object::AUTHORITY(3pm)