Sponsored Content
Top Forums Shell Programming and Scripting Issue handling single quoted argument in shell script. Post 303039370 by gull04 on Wednesday 2nd of October 2019 08:38:09 AM
Old 10-02-2019
Hi,

Thanks for the detailed explanation, such things are always worth while for mw.

Regards

Gull04
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

signal handling in shell script

Hi can any please tell me is it possible to catch the signal in a shell script like we do in C. if yes please give me some idea or a link. (4 Replies)
Discussion started by: Raom
4 Replies

2. Shell Programming and Scripting

Shell script file handling

Hi ! /bin/sh set logdir1 "logDir/local/logname" #write the filename into a file echo $logdir1 >> logname.txt how do i exec the above echo command (1 Reply)
Discussion started by: nathgopi214
1 Replies

3. Shell Programming and Scripting

Handling values with space while passing commandline argument from wrapper script in KSH

Hi there, I have a wapper script which passes the argument from command prompt to inner script.. It works fine as long as the argument containing single word. But when value contains multiple word with space, not working as expected. I tried my best, couldn't find the reason. Gurus, pls.... (2 Replies)
Discussion started by: kans
2 Replies

4. Shell Programming and Scripting

Issue with Error handling,not able to continue the script further

Hi, I am trying to write a script to cleanup files in a log directory .. cd log find Datk** -mtime +7 -exec rm -f {} \; 2> /dev/null Have used the above to clean up files in log directory more then 7 days older. The file can be something like ( auto-generate by some processes and... (2 Replies)
Discussion started by: nss280
2 Replies

5. Shell Programming and Scripting

Take quoted output from one script as quoted input for another script

Hi, I have a script output.sh which produces the following output (as an example): "abc def" "ghi jkl" This output should be handled from script input.sh as input and the quotes should be treated as variable delimiters but not as regular characters. input.sh (processing positional... (2 Replies)
Discussion started by: stresing
2 Replies

6. Shell Programming and Scripting

Help with Handling multiple argument in shell script

Hi i have written a shell script that takes only single ip address from the user and calculates its latency and reliability, can you please tell me that what should be done if i want that user should enter 100 or 1000 ip address (5 Replies)
Discussion started by: Preeti_17
5 Replies

7. Shell Programming and Scripting

Issue while executing C executable with argument in shell script

Hi All, I am new to this forum and also shell script :) My task is I have to read CSV file get the data from the file and use the data to call c executable with data as argument.And the output from c executable should be stored to new CSV file Please find below my code testfunction() {... (14 Replies)
Discussion started by: ravjot28
14 Replies

8. Shell Programming and Scripting

Make multiple lines into single quoted comma separated Linux

Hi, I want to change a file file1.txt: 1234 3456 2345 6789 3456 2333 4444 As, file2.txt in Linux: '1234','3456','2345','6789','3456','2333','4444' Could someone please help me. (Single liner sed, awk will be welcome!) (7 Replies)
Discussion started by: wiweq05
7 Replies

9. Shell Programming and Scripting

Replace double quotes with a single quote within a double quoted string

Hi Froum. I have tried in vain to find a solution for this problem - I'm trying to replace any double quotes within a quoted string with a single quote, leaving everything else as is. I have the following data: Before: ... (32 Replies)
Discussion started by: pchang
32 Replies

10. Shell Programming and Scripting

Shell Script Help..Renaming Quoted files removing the timestamp

Hi all, i am new to this forum, unix and shell scripting. I would really appreciate if you all can help me here.. I have files coming in the below format 'filename20513'13May06:03:45 filename are characters.. like 'ABDDUT20513'13May06:03:45 i need it to be renamed as... (17 Replies)
Discussion started by: khman
17 Replies
Algorithm::C3(3)					User Contributed Perl Documentation					  Algorithm::C3(3)

NAME
Algorithm::C3 - A module for merging hierarchies using the C3 algorithm SYNOPSIS
use Algorithm::C3; # merging a classic diamond # inheritance graph like this: # # <A> # / # <B> <C> # / # <D> my @merged = Algorithm::C3::merge( 'D', sub { # extract the ISA array # from the package no strict 'refs'; @{$_[0] . '::ISA'}; } ); print join ", " => @merged; # prints D, B, C, A DESCRIPTION
This module implements the C3 algorithm. I have broken this out into it's own module because I found myself copying and pasting it way too often for various needs. Most of the uses I have for C3 revolve around class building and metamodels, but it could also be used for things like dependency resolution as well since it tends to do such a nice job of preserving local precedence orderings. Below is a brief explanation of C3 taken from the Class::C3 module. For more detailed information, see the "SEE ALSO" section and the links there. What is C3? C3 is the name of an algorithm which aims to provide a sane method resolution order under multiple inheritance. It was first introduced in the language Dylan (see links in the "SEE ALSO" section), and then later adopted as the preferred MRO (Method Resolution Order) for the new-style classes in Python 2.3. Most recently it has been adopted as the 'canonical' MRO for Perl 6 classes, and the default MRO for Parrot objects as well. How does C3 work. C3 works by always preserving local precedence ordering. This essentially means that no class will appear before any of it's subclasses. Take the classic diamond inheritance pattern for instance: <A> / <B> <C> / <D> The standard Perl 5 MRO would be (D, B, A, C). The result being that A appears before C, even though C is the subclass of A. The C3 MRO algorithm however, produces the following MRO (D, B, C, A), which does not have this same issue. This example is fairly trivial, for more complex examples and a deeper explanation, see the links in the "SEE ALSO" section. FUNCTION
merge ($root, $func_to_fetch_parent, $cache) This takes a $root node, which can be anything really it is up to you. Then it takes a $func_to_fetch_parent which can be either a CODE reference (see SYNOPSIS above for an example), or a string containing a method name to be called on all the items being linearized. An example of how this might look is below: { package A; sub supers { no strict 'refs'; @{$_[0] . '::ISA'}; } package C; our @ISA = ('A'); package B; our @ISA = ('A'); package D; our @ISA = ('B', 'C'); } print join ", " => Algorithm::C3::merge('D', 'supers'); The purpose of $func_to_fetch_parent is to provide a way for "merge" to extract the parents of $root. This is needed for C3 to be able to do it's work. The $cache parameter is an entirely optional performance measure, and should not change behavior. If supplied, it should be a hashref that merge can use as a private cache between runs to speed things up. Generally speaking, if you will be calling merge many times on related things, and the parent fetching function will return constant results given the same arguments during all of these calls, you can and should reuse the same shared cache hash for all of the calls. Example: sub do_some_merging { my %merge_cache; my @foo_mro = Algorithm::C3::Merge('Foo', &get_supers, \%merge_cache); my @bar_mro = Algorithm::C3::Merge('Bar', &get_supers, \%merge_cache); my @baz_mro = Algorithm::C3::Merge('Baz', &get_supers, \%merge_cache); my @quux_mro = Algorithm::C3::Merge('Quux', &get_supers, \%merge_cache); # ... } CODE COVERAGE
I use Devel::Cover to test the code coverage of my tests, below is the Devel::Cover report on this module's test suite. ------------------------ ------ ------ ------ ------ ------ ------ ------ File stmt bran cond sub pod time total ------------------------ ------ ------ ------ ------ ------ ------ ------ Algorithm/C3.pm 100.0 100.0 100.0 100.0 100.0 100.0 100.0 ------------------------ ------ ------ ------ ------ ------ ------ ------ Total 100.0 100.0 100.0 100.0 100.0 100.0 100.0 ------------------------ ------ ------ ------ ------ ------ ------ ------ SEE ALSO
The original Dylan paper <http://www.webcom.com/haahr/dylan/linearization-oopsla96.html> The prototype Perl 6 Object Model uses C3 <http://svn.openfoundry.org/pugs/perl5/Perl6-MetaModel/> Parrot now uses C3 <http://aspn.activestate.com/ASPN/Mail/Message/perl6-internals/2746631> <http://use.perl.org/~autrijus/journal/25768> Python 2.3 MRO related links <http://www.python.org/2.3/mro.html> <http://www.python.org/2.2.2/descrintro.html#mro> C3 for TinyCLOS <http://www.call-with-current-continuation.org/eggs/c3.html> AUTHORS
Stevan Little, <stevan@iinteractive.com> Brandon L. Black, <blblack@gmail.com> COPYRIGHT AND LICENSE
Copyright 2006 by Infinity Interactive, Inc. <http://www.iinteractive.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2017-10-06 Algorithm::C3(3)
All times are GMT -4. The time now is 04:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy