Following may help you in same.
Now we can see output will be as follow in file.
Now if you want to call these variables into a new script as variable pass, you can use it but it will be little tricky one as per your requirement we need to always print variables from var1 to var8 only so there will be duplicate entries in output file, if you can open your requirement little broader it will be better for us to understand and help you, hope this helps.
Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
Hi all..
I got a problem..
Its easy to redirect o/p to a file.. But Is it possible to redirect the O/P to a variable?
For example:
I've a command in my script:
string1=cut -d ':' -f2 file.txt
When I do:
echo $string1
The value is empty... Pls suggest me how to store the value... (7 Replies)
Hello guys
I need to run a script to remove the last column of different comma separated files.
The problem is that the number of columns of my files will be different and I won't know that number every time i run my script.
Is there any command I can use to remove the last column without... (7 Replies)
Hi,
I am trying to do the following thing
var='date'
$var
Above command substitutes date for and in turn runs the date command and i am getting the todays date value.
I am trying to do the same thing as following, but facing some problems,
unique_host_pro="sed -e ' /#/d'... (3 Replies)
Hi All, I am a newbie to unix.starting my career in unix.need 1 help from you all..pls help..
i am passing a file name "abc_delta" as argument to my script1.sh.
if file name contains "_delta" at last then echo pass else fail.how to fix it.
Note:file name will always contain "_delta" at... (10 Replies)
I typically pull a bunch of data via SQL that lists a bunch of users and the server on which they want to access, as well as other attributes, in one row of an excel sheet and the number of rows is directly proportionate to the number of users.
I'm trying to write a loop to read each line of the... (2 Replies)
My scenario is that I need to pick value from third column based on fourth column value, if fourth column value is 1 then first value of third column.Third column (2|3|4|6|1) values are cancatenated.
Please someone help me to resolve this issue.
Source
column1 column2 column3 column4... (2 Replies)
These seems ridiculously simple but I can't get it to work. Using korn shell and I want to pass in a flag to tell my echo statements to either write to the screen for debugging or a file if not. So I have something like:
if ; then
logout=&1
else
logout='logfile.out'
fi
Then... (2 Replies)
Hi All,
Daily I am generating a file dfm_daily_file_
ex: dfm_daily_file_05072015 date will be changed daily.
Once the file is FTP it is deleted.
I have tried the below code to get the file name with any date and store it in a variable its not working.
#!/bin/ksh ... (4 Replies)
Need your support for below. Please help to get required output
If column 5 is INV then only consider column1 and take out duplicates/identical rows/values from column1 and then put minimum value of column6 in column7 and put maximum value in column 8 and then need to do subtract values of... (7 Replies)
Discussion started by: as7951
7 Replies
LEARN ABOUT DEBIAN
perl6::say
Perl6::Say(3pm) User Contributed Perl Documentation Perl6::Say(3pm)NAME
Perl6::Say - "print" -- but no newline needed
SYNOPSIS
# Perl 5 code...
use Perl6::Say;
say 'boo'; # same as: print 'boo', "
"
say STDERR 'boo'; # same as: print STDERR 'boo', "
"
STDERR->say('boo'); # same as: print STDERR 'boo',
"
$fh->say('boo'); # same as: print $fh 'boo', "
";
say(); # same as: print "$_
";
say undef; # same as: print "
";
DESCRIPTION
Note for Users of Perl 5.10
You don't need this module. The Perl 6 "say" function is available in Perl 5.10 by saying "use feature 'say';". Hence, this module is of
interest only to users of Perl 5.6 and 5.8.
If you have Perl 5.10 installed, see the 510/ directory in this distribution for some elementary examples of "say" taken from "perldoc fea-
ture".
General
Implements a close simulation of the "say" function in Perl 6, which acts like "print" but automatically appends a newline.
Use it just like "print" (except that it only supports the indirect object syntax when the stream is a bareword). That is, assuming the
relevant filehandles are open for output, you can use any of these:
say @data;
say FH @data;
FH->say(@data);
*FH->say(@data);
(*FH)->say(@data);
say $fh, @data;
$fh->say(@data);
but not any of these:
say {FH} @data;
say {*FH} @data;
say {*FH} @data;
say $fh @data;
say {$fh} @data;
Additional Permitted Usages
As demonstrated in the test suite accompanying this distribution, "Perl6::Say::say()" can be used in all the following situations.
$string = q{};
open FH, ">", $string;
say FH qq{Hello World}; # print to a string
close FH; # requires Perl 5.8.0 or later
use FileHandle;
$fh = FileHandle->new($file, 'w');
if (defined $fh) {
say $fh, qq{Hello World};
$fh->close;
}
use IO::File;
$fh = IO::File->new($file, 'w');
if (defined $fh) {
say $fh, qq{Hello World};
$fh->close;
}
$string = q{};
open FH, ">", $string; # requires Perl 5.8.0 or later
select(FH);
say qq{Hello World};
close FH;
Interaction with Output Record Separator
In Perl 6, "say @stuff" is exactly equivalent to "Core::print @stuff, "
"".
That means that a call to "say" appends any output record separator (ORS) after the added newline (though in Perl 6, the ORS is an
attribute of the filehandle being used, rather than a global $/ variable).
"IO::Handle::say()"
IO::Handle version 1.27 or later (which, confusingly, is found in IO distribution 1.23 and later) also implements a "say" method.
Perl6::Say provides its own "say" method to IO::Handle if "IO::Handle::say" is not available.
Usage with Older Perls
As noted above, some aspects of "Perl6::Say::say()" will not work with versions of Perl earlier than 5.8.0. This is not due to any problem
with this module; it is simply that Perl did not support printing to an in-memory file ("print $string, "
";") prior to that point.
(Thanks to a CPAN testers report from David Cantrell for identifying this limitation.)
WARNING
The syntax and semantics of Perl 6 is still being finalized and consequently is at any time subject to change. That means the same caveat
applies to this module.
DEPENDENCIES
No dependencies other than on modules included with the Perl core as of version 5.8.0.
Some of the files in the test suite accompanying this distribution use non-core CPAN module IO::Capture::Stdout. Tests calling IO::Cap-
ture::Stdout methods are enclosed in "SKIP" blocks and so should pose no obstacle to installation of the distribution on systems lacking
IO::Capture. (However, the maintainer strongly recommends IO::Capture for developers who write a lot of test code. So please consider
installing it!)
AUTHOR and MAINTAINER
AUTHOR
Damian Conway (damian@conway.org).
MAINTAINER
James E Keenan (jkeenan@cpan.org) (effective v0.06, July 2006).
ACKNOWLEDGMENTS
Thanks to Damian Conway for dreaming this up. Thanks to David A Golden for a close review of the documentation. Thanks to CPAN tester
Jost Krieger for reporting an error in my SKIP block count in one test file.
BUGS AND IRRITATIONS
As far as we can determine, Perl 5 doesn't allow us to create a subroutine that truly acts like "print". That is, one that can simultane-
ously be used like so:
say @data;
and like so:
say {$fh} @data;
Comments, suggestions, and patches welcome.
COPYRIGHT
Copyright (c) 2004, Damian Conway. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under
the same terms as Perl itself.
perl v5.8.8 2008-02-09 Perl6::Say(3pm)