Between those two starting and ending lines there are thousands of lines stating the file transfer like normal Rsync does. I just skipped them because it might have filled the whole page.
Hi
I want to read a file line by line and search for a particular string in each line(say for example string containing @ )and save that string into a variable.
Can someone suggest me the way to implement it.I am using K- shell
Thanks
Ishita (5 Replies)
For a Script I need to detemine which field of the unix environment variable SHLIB_PATH has the
WALTDB entry.
export SHLIB_PATH=/usr/user5/WALTDB/oracle/product/10.2.0/lib32:/usr/TZD/bin.wdad/mug/oracle/lib:
echo $SHLIB_PATH | awk -F: '{ print $1 }'
Shure gives me the first entry, but... (6 Replies)
guys,
I need to know how to assing pattern matched string as an input command variable. Here it goes'
My script is something like this.
./routing.sh <Server> <enable|disable>
## This Script takes an input <Server> variable from this line of the script ##
echo $1 | egrep... (1 Reply)
I want to replace a certain pattern with the variable already defined.
e.g.
set path_verilog = /home/priya/bin/verilogfile
my file contents are :
verilog new
verilog is defined here verilog_path_comes
I am using the below command
sed 's/verilog_path_comes/'$path_verilog'/g' <filename>... (2 Replies)
Im trying to parse ifconfig with awk and setup a bunch of variables in one shot. But Im having trouble figuring out how to work with data in previous lines.
ifconfig output:
eth0 Link encap:Ethernet HWaddr 00:50:DA:10:7F:1B
inet addr:10.10.10.10 Bcast:10.10.10.127 ... (0 Replies)
hi,
i have a variable which contains some file names delimited by a single space.
FNAME="s1.txt s2.lst s3.cvs s4.lst"
i have another variable that contains a pattern
FILE_PATTERN="*.lst"
i want to take the filenames from FNAME variable and assign each file name in to an array say
for... (8 Replies)
Hi Forum.
I have the following script that I would like to use a variable to search using awk but it's not working as expected:
# Define working variables
token_search_string=536088
token_search_length=16
This code example works by hardcoding 536088 in the string search:
awk -v... (10 Replies)
I have this fileA
TEST FILE ABC
this file contains ABC;
TEST FILE DGHT this file contains DGHT;
TEST FILE 123
this file contains ABC,
this file contains DEF,
this file contains XYZ,
this file contains KLM
;
I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Hello,
We have wrote shell script for multiple file name search pattern.
file format: <numner>_<20180809>.txt
starting with single number and ending with 8 digits number
Command:
awk -v string="12_1234" -v serch="^+_+$" "BEGIN{ if (string ~/serch$/) print string }"
If sting matches... (4 Replies)
Hi,
I have a working script.
It does what I am intending it to but a bit confused whether the sed part is supposed to be working or not. Further down is the script with the sed part that should have been working but not and the grep -v part which is the workaround that I am using at the... (10 Replies)
Discussion started by: newbie_01
10 Replies
LEARN ABOUT DEBIAN
ropkg::rsync::atom
RoPkg::Rsync::Atom(3pm) User Contributed Perl Documentation RoPkg::Rsync::Atom(3pm)NAME
RoPkg::Rsync::Atom - the smallest unit in a rsync configuration file
SYPONSIS
#!/usr/bin/perl
use strict;
use warnings;
use RoPkg::Rsync::Atom;
sub main {
my $a = new RoPkg::Rsync::Atom(
type => 'param',
name => 'uid',
value => 'nobody',
);
print $a->ToString(0),$/;
return 0;
}
main();
DESCRIPTION
RoPkg::Rsync::Atom is a class used by RoPkg::Rsync modules. The Atom is considered the smallest part of any rsync configuration file. An
atom can be (at this moment):
param
blank
comment
METHODS
All methods, throw the OutsideClass exception, if you use them as class methods.
Example:
perl -MRoPkg::Rsync::Atom -e 'RoPkg::Rsync::Atom->Type;'
Called outside class instance
Besides OutsideClass the methods are throwing other exceptions as well. Refer to each method documentation for more information.
new()
The constructor of the class. new accepts 3 parameters grouped inside a hash:
*) type - type of the atom
*) name - name of the atom
*) value - value of the atom
The type parameter must always be present. If the type parameter is not present, a Param::Missing exception is raised. At this moment, the
atoms have 3 types:
*) param - a parameter in the standard form (name = value)
*) comment - a comment
*) blank - a blank line (or only with separators)
If the value of the type parameter is not one of the ones specified a Param::Wrong exception is raised.
Examples:
example 1 (param):
my $a = new RoPkg::Rsync::Atom(
type => 'param',
name => 'gid',
value => 'users',
);
example 2 (param):
my $a = new RoPkg::Rsync::Atom(type => 'param');
$a->Name('gid');
$a->Value('users');
print 'Name of the atom is:',$a->Name,$/;
example 3 (comment):
my $a = new RoPkg::Rsync::Atom(
type => 'comment',
value => '# this is the group id',
);
example 4 (blank):
my $a = new RoPkg::Rsync::Atom(
type => 'blank',
value => q{ },
);
Name($new_name)
The Name method is a get/set method. If $new_name exists (and his value is defined) then the set behaviour is selected, otherwise the
method acts as a get method. Returns the name of the atom.
Value($new_value)
The Value method is a get/set method. If $new_value exists (and his value is defined) then the set behaviour is selected, otherwise the
method acts as a get method. Returns the value of the atom.
ToString($indent, $spaces)
Returns the string representation of the atom. Accepts 2 parameters: indent and spaces. $indent is a true/false value specifing that the
string representation should be prefixed with a tab character; $spaces is used to compute the number of spaces that should be added after
the atom name, so that the total length of the parameter name to match the $spaces value.
Example:
my $a = new RoPkg::Rsync::Atom(
type => 'param',
name => 'gid',
value => 'users',
);
print $a->ToString(0, 6),$/,
$a->ToString(0, 5),$/,
$a->ToString(0, 4),$/,
$a->ToString(0, 3),$/,
$a->ToString(1, 6),$/,
$a->ToString(1, 5),$/,
$a->ToString(1, 4),$/,
$a->ToString(1, 3),$/;
The result is:
gid = users
gid = users
gid = users
gid = users
gid = users
gid = users
gid = users
gid = users
Type
Returns the type (string representation) of the atom.
PREREQUISITES
perl 5.008 (or later) is required. Besides perl, you must have the following:
RoPkg::Exceptions
English
Scalar::Util
SEE ALSO
RoPkg::Rsync::Node RoPkg::Rsync::ConfFile RoPkg::Exceptions
AUTHOR
Subredu Manuel <diablo@iasi.roedu.net>
LICENSE
Copyright (C) 2005 Subredu Manuel. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the
same terms as Perl itself. The LICENSE file contains the full text of the license.
perl v5.8.8 2006-06-09 RoPkg::Rsync::Atom(3pm)