08-18-2008
Thank you very much, I appreciate your help.
The problem I am still having is that I am looking to find the final extension of a file name and the file name may have multiple nodes.
If the l_comp="dc000.runksh.test.ksh|/dbmgtu01/app/oracle/orbitz/1.0.0/sql/dc0000.runksh_test.sql|new.dat|control.ctl"
lf_verify_component () {
l_comp_file=$i
l_comp_suffix=${i#*.}
echo ' Component File: ' $l_comp_file
echo ' Component Suffix: ' $l_comp_suffix
} # end of lf_verify_component
The outpiut I get is:
Component File: dc000.runksh.test.ksh
Component Suffix: runksh
Component File: /dbmgtu01/app/oracle/orbitz/1.0.0/sql/dc0000.runksh_test.sql
Component Suffix: 0
Component File: new.dat
Component Suffix: dat
Component File: control.ctl
Component Suffix: ctl
How can I code it so that it only gives me the string after the final "."?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a function check_ok in my abc.sh. which return me 1 or 0 . I want to call this fuction through other shell script. this shell also send two parameter to calling function.
Can you please tell me how. I am very new in unix.
#!/bin/bash
date_equal()
{
sqlplus -silent... (4 Replies)
Discussion started by: Jamil Qadir
4 Replies
2. Shell Programming and Scripting
hi,
can any one help me to correct this function call.
awk -F "," '{ {first=$1; sec=$2; tro=$3;quat=$4 }
if (tro == "")
{
$3 = search "$file2" "$first" "$file3"
{print $1","$2","$3","$4} }
else
{print $1","$2","$3 $4}}' $file1 > $file
search ()
{ (2 Replies)
Discussion started by: kamel.seg
2 Replies
3. Shell Programming and Scripting
Hi All,
Can you please tell me how to execute local function written in a shell script with awk.
i tried with system command but its giving an error. (1 Reply)
Discussion started by: krishna_gnv
1 Replies
4. Infrastructure Monitoring
Hello,
I have a problem with package and name space.
require "/Mehran/DSGateEngineLib/general.pl";
use strict;
sub System_Status_Main_Service_Status_Intrusion_Prevention
{
my %idpstatus;
my @result;
&General_ReadHash("/var/dsg/idp/settings",\%idpstatus);
#print... (4 Replies)
Discussion started by: Zaxon
4 Replies
5. Shell Programming and Scripting
#!/bin/bash
awk '
function ad(t,r){
return (t+r);
}
BEGIN{
print ad(5,3);
}
{
print ad(5,3);
}
'
Doesn't print anything for the last print ad(5,3); (6 Replies)
Discussion started by: cola
6 Replies
6. Shell Programming and Scripting
The following code doesn't work properly which means it doesn't displays remote output.
#!/bin/ksh
#################### Function macAddressFinder ########################
macAddressFinder()
{
`ifconfig -a > ipInterfaces`
`cat ipInterfaces`
}... (2 Replies)
Discussion started by: presul
2 Replies
7. Shell Programming and Scripting
hi everyone
i am trying to do this
bash> cat abc.sh
deepak()
{
echo Deepak
}
deepak
bash>./abc.sh
Deepak
so it is giving me write simply i created a func and it worked
now i modified it like this way
bash> cat abc.sh (2 Replies)
Discussion started by: aishsimplesweet
2 Replies
8. Shell Programming and Scripting
Below is my script that is function properly per my conditions but I am facing one problem here that is when one function fails then Iy should not check other functions but it calls the other function too So anyone can help me how could i achieve this?
iNOUT i AM GIVING TO THE... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies
9. UNIX for Beginners Questions & Answers
My requirement is to call function ("fun1") from awk, and print its returned value along with $0.
fun1()
{
t=$1
printf "%02d\n", $t % 60;
}
echo "Hi There 23" | awk '{print $0; system(fun1 $3)}'
Any suggestions what to be modified in above code to achieve requirement.. (5 Replies)
Discussion started by: JSKOBS
5 Replies
10. Shell Programming and Scripting
Hello,
I have this awk code in a bash script to perform a find and replace task. This finds one unique line in a file and substitutes the found line with a replacement.
#! /bin/bash
# value determined elsewhere
total_outputs_p1=100
# file being modified... (5 Replies)
Discussion started by: LMHmedchem
5 Replies
LEARN ABOUT DEBIAN
mason::component::moose
Mason::Component::Moose(3pm) User Contributed Perl Documentation Mason::Component::Moose(3pm)
NAME
Mason::Component::Moose - Moose policies and exports for Mason components
DESCRIPTION
This module is automatically included in each generated Mason component class, and is equivalent to
use CLASS;
use Moose;
use MooseX::HasDefaults::RW;
use Method::Signatures::Simple;
OVERRIDING
To override the default behavior, subclass this class and specify it as "base_component_moose_class" to Mason::Interp.
For example, to use MooseX::StrictConstructor in every component:
package My::Mason::Component::Moose;
use Moose::Exporter;
use MooseX::StrictConstructor ();
use base qw(Mason::Component::Moose);
sub init_meta {
my $class = shift;
$class->SUPER::init_meta(@_);
MooseX::StrictConstructor->init_meta(@_);
}
...
my $interp = Mason::Interp->new(..., base_component_moose_class => 'My::Mason::Component::Moose');
SEE ALSO
Mason
AUTHOR
Jonathan Swartz <swartz@pobox.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Jonathan Swartz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-05-02 Mason::Component::Moose(3pm)