Hi,
I needs to split *.txt files from single directory depends on the some mutltiple input values. i have wrote the code like below
for file in *.txt
do
grep -i -h "value1|value2" $file > $file;
done.
My requirment is more input values needs to be given in grep; let us say 50... (3 Replies)
I have three files a.txt , b.txt , c.txt in a directory called my_dir1 .These files were created before two or three months . I have a tar file called my_tar1.tar which contains three files a.txt , b.txt , d.txt . Somebody untarred the my_tar1.tar into my_dir1 directory. So existing two files were... (1 Reply)
Hi All,
I am using the awk command to replace ',' by '\t' (tabs) in a csv file. I would like to apply this to all .csv files in a directory and create .txt files with the tabs.
How would I do this in a script?
I have the following script called "csvtabs":
awk 'BEGIN {
FS... (4 Replies)
Hi everyone,
when executing this command in unix:
echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error.
here is content of my script:
tdbsrvr$ vi hc.sh
"hc.sh" 22 lines, 509... (4 Replies)
I know I can use an ls -l junk1 command to get a listing of all files in the directory junk1, but I was wondering how I'd go about going through the files in junk1 in a for-in loop and issuing the ls -l command on them one by one.
This is what I have so far:
for file in $(ls -a $1)
do
ls... (1 Reply)
HI Guys,
I hope you are well. I am trying to write a script that gets executed every time i open a shell (cshell). I have two questions about that
1) I need to enter these commands
$ echo $DISPLAY
$ setenv $DISPLAY output_of_echo_$display_command
How can i write a... (2 Replies)
I have a tar file that contains multiple .Z files. Hence I need to issue a tar command followed by a gzip command to fully extract the files. How do I do it in a single command?
What I'm doing now is
tar xvf a.tar (this will output 1.Z and 2.Z)
gzip -d *.Z (to extract 1.Z and 2.Z) (9 Replies)
Hi,
I am using solaris 10 OS.Please help me out with the commands needed in below two scenarios.
1)How to delete the existing files in the tar file.
suppose i have a main tarfile named application.tar and it contains a file called ingres.tar.
what is the command to remove ingres.tar... (2 Replies)
08:29 < xsi> >{respo,nd}.php bash: {respo,nd}.php: ambiguous redirect
08:31 < geirha> xsi: maybe you want tee
So I was advised to do so. And I can't create two OR MORE files at once with {a,b,c,d,e,f}.php
(which I quickly now need to create and to learn to create in the future to quickly... (2 Replies)
Hello, i am trying to print group name column(etc/group) on script (etc/passwd) since group name is not listed on etc/passwd columns. Im trying to do a vlookup. but i cant figure out how i can insert the vlookup command FNR==NR inside the print out command or the output. I also tried exporting... (2 Replies)
Discussion started by: joonisio
2 Replies
LEARN ABOUT MOJAVE
modperl::code
ModPerl::Code(3) User Contributed Perl Documentation ModPerl::Code(3)NAME
$class::Const - Perl Interface for $class Constants
SYNOPSIS CONSTANTS
EOF
my $groups = $data{$class};
for my $group (sort keys %$groups) {
print $fh <<"EOF";
":$group"
use $class::Const -compile qw(:$group);
The ":$group" group is for XXX constants.
EOF
for my $const (sort @{ $groups->{$group} }) {
print $fh "=head3 C<$class::$const>
";
}
}
print $fh "=cut
";
}
}
sub generate_constants_lookup_doc {
my ($data) = @_;
foreach my $class (sort keys %$Apache2::ConstantsTable) {
my $groups = $Apache2::ConstantsTable->{$class};
my $constants = [sort map { @$_ } values %$groups];
constants_lookup_code_doc($constants, $class, $data);
}
}
sub generate_constants_group_lookup_doc {
my ($data) = @_;
foreach my $class (sort keys %$Apache2::ConstantsTable) {
my $groups = $Apache2::ConstantsTable->{$class};
constants_group_lookup_code_doc($class, $groups, $data);
}
}
sub constants_group_lookup_code_doc {
my ($class, $groups, $data) = @_;
my @tags;
my @code;
while (my ($group, $constants) = each %$groups) {
$data->{$class}{$group} = [
map {
my @ifdef = constants_ifdef($_);
s/^($constant_prefixes)_?//o;
$seen_const{$class}{$_}++;
$_;
} @$constants
];
}
}
sub constants_lookup_code_doc {
my ($constants, $class, $data) = @_;
my (%switch, %alias);
%alias = %shortcuts;
my $postfix = lc $class;
my $package = $class . '::';
my $package_len = length $package;
my $func = canon_func(qw(constants lookup), $postfix);
for (@$constants) {
if (s/^($constant_prefixes)(_)?//o) {
$alias{$_} = join $2 || "", $1, $_;
}
else {
$alias{$_} ||= $_;
}
next unless /^([A-Z])/;
push @{ $switch{$1} }, $_;
}
for my $key (sort keys %switch) {
my $names = $switch{$key};
for my $name (@$names) {
my @ifdef = constants_ifdef($alias{$name});
push @{ $data->{$class}{other} }, $name
unless $seen_const{$class}{$name}
}
}
}
sub generate_exports {
my ($self, $c_fh) = @_;
require ModPerl::WrapXS;
ModPerl::WrapXS->generate_exports($c_fh); }
# src/modules/perl/*.c files needed to build APR/APR::* outside # of mod_perl.so sub src_apr_ext {
return map { "modperl_$_" } (qw(error bucket),
map { "common_$_" } qw(util log)); }
1; __END__
NAME
ModPerl::Code - Generate mod_perl glue code
SYNOPSIS
use ModPerl::Code ();
my $code = ModPerl::Code->new;
$code->generate;
DESCRIPTION
This module provides functionality for generating mod_perl glue code. Reason this code is generated rather than written by hand include:
consistency
thin and clean glue code
enable/disable features (without #ifdefs)
adapt to changes in Apache
experiment with different approaches to gluing
AUTHOR
Doug MacEachern
perl v5.18.2 2015-06-18 ModPerl::Code(3)