Hi,
I am new to ksh scripting so your help will be much appreciated.
I have a file called file.txt which looks like this
Header 20050702 20050703
ABC
DEF
Header 20050703 20050704
123
456
Header 20050704 20050705
XXX
YYY
What I am trying to do is write out each of the record... (7 Replies)
Below is part of a script i have written to loop through part of a port info file. How do i continue the script to get info for OS Device Name, manufacturer and then put information into an array?
HBA Port WWN: 10000000c9420b4b
OS Device Name: /dev/cfg/c10
Manufacturer: Emulex... (5 Replies)
Hi,
i am pretty new to Unix environment .....
Can i get some help from any of you guyz on writing Unix script.
my requirement is like reading a csv file, finding a specific pattern in the lines and repalce the string with new string and write it to another file.
My file is file ABC123.dat... (3 Replies)
NEWBIE ALERT!
Hi,
I'm 1 month into learning Perl and done reading "Minimal Perl" by Tim Maher (which I enjoyed enoumously). I'm not a programmer by profession but want to use Perl to automate various tasks at my job. I have a problem (obviously) and are looking for your much appreciated help.... (0 Replies)
hey frns pls help me out !!
i hav a code of c that i have to include in my project.
i am using a device (geomeda) that has unix based OS. it also support SIM card for connecting to server . I need to send SMS to user from this device..
below code is not working .. i am unable to send sms and the... (7 Replies)
Hi All,
I created a nfs share in the server(Solaris 10) with the following command and also updated the dfstab file
share -F nfs -o rw=server_name2,anon=0 /to_share
And then in the client(solaris 10) added the following command to mount the share
mount -F nfs server_name1:/to_share... (4 Replies)
I'm taking a unix class and need to countdown to 0 from whatever number the user inputs. I know how to do this with a while or until loop but using the for loop is throwing me off....
I know I can use an if-then statement in my for loop but can I include a while loop in my for loop? (3 Replies)
Hello All,
I'm working on a script that will actually read a file consisting of data like the below:(ReportID,Sub_reportID,Sub_reportName)
1,1,ABC
1,2,DEF
1,3,GHI
2,1,JKL
2,2,MNO
3,1,PQR
I want to read the Sub Report details for a Report_ID using while loop and write these values into... (6 Replies)
Hi,
I have exported a few nfs mounts from one server to the nfs clients.
This is my nfs server dfstab :
# cat /etc/dfs/dfstab
# place share(1M) commands here for automatic execution
# on entering init state 3.
#
# share <pathname>
# .e.g,
# share -F... (3 Replies)
Discussion started by: anaigini45
3 Replies
LEARN ABOUT DEBIAN
config::yaml
Config::YAML(3pm) User Contributed Perl Documentation Config::YAML(3pm)NAME
Config::YAML - Simple configuration automation
VERSION
Version 1.42
SYNOPSIS
Config::YAML is a somewhat object-oriented wrapper around the YAML module which makes reading and writing configuration files simple.
Handling multiple config files (e.g. system and per-user configuration, or a gallery app with per-directory configuration) is a snap.
use Config::YAML;
# create Config::YAML object with any desired initial options
# parameters; load system config; set alternate output file
my $c = Config::YAML->new( config => "/usr/share/foo/globalconf",
output => "~/.foorc",
param1 => value1,
param2 => value2,
...
paramN => valueN,
);
# integrate user's own config
$c->read("~/.foorc");
# integrate command line args using Getopt::Long
$rc = GetOptions ( $c,
'param1|p!',
'param2|P',
'paramN|n',
);
# Write configuration state to disk
$c->write;
# simply get params back for use...
do_something() unless $c->{param1};
# or get them more OO-ly if that makes you feel better
my $value = $c->get_param2;
METHODS
new
Creates a new Config::YAML object.
my $c = Config::YAML->new( config => initial_config,
output => output_config
);
The "config" parameter specifies the file to be read in during object creation. It is required, and must be the first parameter given. If
the second parameter is "output", then it is used to specify the file to which configuration data will later be written out. This
positional dependency makes it possible to have parameters named "config" and/or "output" in config files.
Initial configuration values can be passed as subsequent parameters to the constructor:
my $c = Config::YAML->new( config => "~/.foorc",
foo => "abc",
bar => "xyz",
baz => [ 1, 2, 3 ],
);
get_*/set_*
If you'd prefer not to directly molest the object to store and retrieve configuration data, autoloading methods of the forms "get_[param]"
and "set_[param]" are provided. Continuing from the previous example:
print $c->get_foo; # prints "abc"
my $val = $c->get_quux; # $c->{quux} doesn't exist; returns undef
$c->set_bar(30); # $c->{bar} now equals 30, not "xyz"
my @list = qw(alpha beta gamma);
$c->set_baz(@list); # $c->{baz} now a reference to @list
fold
Convenience method for folding multiple values into the config object at once. Requires a hashref as its argument.
$prefs{theme} = param(theme);
$prefs{format} = param(format);
$prefs{sortby} = param(order);
$c->fold(\%prefs);
my $format = $c->get_format; # value matches that of param(format)
read
Imports a YAML-formatted config file.
$c->read('/usr/share/fooapp/fooconf');
"read()" is called at object creation and imports the file specified by "new(config=>)", so there is no need to call it manually unless
multiple config files exist.
write
Dump current configuration state to a YAML-formatted flat file.
$c->write;
The file to be written is specified in the constructor call. See the "new" method documentation for details.
DEPRECATED METHODS
These methods have been superceded and will likely be removed in the next release.
get
Returns the value of a parameter.
print $c->get('foo');
set
Sets the value of a parameter:
$c->set('foo',1);
my @paints = qw( oil acrylic tempera );
$c->set('paints', @paints);
AUTHOR
Shawn Boyette ("<mdxi@cpan.org>")
Original implementation by Kirrily "Skud" Robert (as "YAML::ConfigFile").
BUGS
o Config::YAML ignores the YAML document separation string ("---") because it has no concept of multiple targets for the data coming from
a config file.
Please report any bugs or feature requests to "bug-yaml-configfile@rt.cpan.org", or through the web interface at <http://rt.cpan.org>. I
will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
COPYRIGHT & LICENSE
Copyright 2004 Shawn Boyette, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2010-03-07 Config::YAML(3pm)