I have this simple script which gives info on HBA ports. How do i get it all to print on the same line?
!#/bin/ksh
TMP_INFOFILE=/tmp/tmpfile
if ; then
rm -f $TMP_INFOFILE
touch $TMP_INFOFILE
fi
PORT_INFOFILE=/tmp/aa
if ; then
rm -f $PORT_INFOFILE
... (1 Reply)
I have an output that I get from while read, I want to display it as the following, please help.
Original output from while read line loop:
This is my client=1
client version=2.3.4
OS version=4.5
This is my client=2
client version=1.5.6
OS version=6.7
I want it to look like this with... (7 Replies)
I am trying to have a script ping all the clients then output it to a file so I know which clients are off then have the next script pull the ones that are online and reboot them.
This is what I am running with right now. If there is something KISS then by all means please let me know.
... (3 Replies)
I have a .csv file which is seperated with (;)
inputfile
---------
ZZZZ;AAAA;BBB;CCCC;DDD;EEE;
YYYY;BBBB;CCC;DDDD;EEE;FFF;
...
...
reading file line by line till end of file.
while reading each line output format should be .
i need to print only specific columns let say 5th... (2 Replies)
Hi Following is the assumed input...
Symmetrix ID : 12345
Originator Port wwn : 123456789
User-generated Name : 123456789/123456789
Sym Dev Dir:P LUN
------ ----- ----------------------- ---- --- ---- ---- ---- -------
1234 ... (4 Replies)
performing this code to read from file and print each character in separate line
works well with ASCII encoded text
void
preprocess_file (FILE *fp)
{
int cc;
for (;;)
{ cc = getc (fp);
if (cc == EOF)
break;
printf ("%c\n", cc);
}
}
int
main(int... (1 Reply)
Hi
I want to extend following command so that on the basis of "Branch: ****" on the third line I can grep and print name of the file on the first line.
cat .labellog.emd | grep DA2458A7962276A7E040E50A0DC06459 | cut -d " " -f2 | grep -v branch_name | xargs -I file <command to describe> file
... (1 Reply)
example of problem:
when I echo "$e" >> /home/cogiz/file.txt
result prints to file as:AA
BB
CC
I need it to save to file as this:AA BB CC
I know it's probably something really simple but any help would be greatly appreciated.
Thank You.
Cogiz (7 Replies)
Hi,
I have some 2000 names in a table like below.
Java
Oracle/SQL
ANSI SQL
SQL,DWH,DB
DB&Java
And by using for loop in my code i am able to get a single word but if there is any special character or space then it is considering as a next line.
I have to execute the below queries in... (10 Replies)
Perl::Critic::Policy::ControlStructures::ProhibitUnreachUserCContributed Perl DPerl::Critic::Policy::ControlStructures::ProhibitUnreachableCode(3)NAME
Perl::Critic::Policy::ControlStructures::ProhibitUnreachableCode - Don't write code after an unconditional "die, exit, or next".
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
This policy prohibits code following a statement which unconditionally alters the program flow. This includes calls to "exit", "die",
"return", "next", "last" and "goto". Due to common usage, "croak" and "confess" from Carp are also included.
Code is reachable if any of the following conditions are true:
o Flow-altering statement has a conditional attached to it
o Statement is on the right side of an operator "&&", "||", "//", "and", "or", or "err".
o Code is prefixed with a label (can potentially be reached via "goto")
o Code is a subroutine
EXAMPLES
# not ok
exit;
print "123
";
# ok
exit if !$xyz;
print "123
";
# not ok
for ( 1 .. 10 ) {
next;
print 1;
}
# ok
for ( 1 .. 10 ) {
next if $_ == 5;
print 1;
}
# not ok
sub foo {
my $bar = shift;
return;
print 1;
}
# ok
sub foo {
my $bar = shift;
return if $bar->baz();
print 1;
}
# not ok
die;
print "123
";
# ok
die;
LABEL: print "123
";
# not ok
croak;
do_something();
# ok
croak;
sub do_something {}
CONFIGURATION
This Policy is not configurable except for the standard options.
SEE ALSO
Perl::Critic::Policy::ControlStructures::ProhibitPostfixControls
AUTHOR
Peter Guzis <pguzis@cpan.org>
COPYRIGHT
Copyright (c) 2006-2011 Peter Guzis. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license
can be found in the LICENSE file included with this module.
perl v5.16.3 2014-06-09 Perl::Critic::Policy::ControlStructures::ProhibitUnreachableCode(3)