03-19-2012
Please post the rest of the perl program. May be its possible that there's indeed nothing in $category[$i].
This User Gave Thanks to balajesuri For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
2. Shell Programming and Scripting
Let's say I want to write a program that run these 4 UNIX commands and redirect output to a file.
#!/usr/local/bin/perl
use strict;
`cd \$HOME > output.txt`;
`cut -f1 inputfile.txt >> output.txt`;
`hostname >> output.txt`;
`ifconfig >> output.txt`;
I want to print a "carriage return"... (5 Replies)
Discussion started by: teiji
5 Replies
3. Shell Programming and Scripting
hi All,
cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'
Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies
4. Solaris
Hi all,
First off, sorry for a long post but I think I have no other option if I need to explain properly what I need help for.
I need some advise on how best to check for "faulty" or "stalled/jammed' print queues. At the moment, I have three (3) application servers which also acts as print... (0 Replies)
Discussion started by: newbie_01
0 Replies
5. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
6. Shell Programming and Scripting
What exactly is this code returning:
perl -MConfig -e 'print "$Config{byteorder}\n";'
I am executing this command in two platforms.
In AIX i am getting : 4321
In Linux i am getting: 12345678
Does it mean that a byte size in aix is of 4 bits(is it possible)?
Also, will there be... (2 Replies)
Discussion started by: baig_1988
2 Replies
7. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
8. Shell Programming and Scripting
Look at the following data file(cou.data) which has four fields separated by tab.
Four fields are country name, land area, population, continent where it belongs.
As for country name or continent name which has two words, two words are separated by space.
(Data are not accurately... (1 Reply)
Discussion started by: chihuyu
1 Replies
9. Shell Programming and Scripting
I am trying to use the below sed command to replace all "|" to ^, in a folder had 50 dat files. when i tried with 1 file it worked but when i tried with wild card, is not working.
sed -i 's/"|"/\^/g' *.dat
Is this the proper way to use sed command thank you very much for help. (3 Replies)
Discussion started by: cplusplus1
3 Replies
10. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT DEBIAN
proc::waitstat
WaitStat(3pm) User Contributed Perl Documentation WaitStat(3pm)
NAME
Proc::WaitStat - Interpret and act on wait() status values
SYNOPSIS
$description = waitstat $?;
exit waitstat_reuse $?;
waitstat_die $?, 'program-name';
close_die COMMAND, 'program-name';
DESCRIPTION
This module contains functions for interpreting and acting on wait status values.
Nothing is exported by default.
waitstat wait-status
Returns a string representation of wait() status value wait-status. Values returned are like "0" and "64" and "killed (SIGHUP)".
This function is prototyped to take a single scalar argument.
waitstat_reuse wait-status
Turn wait-status into a value which can be passed to exit, converted in the same manner the shell uses. If wait-status indicates a
normal exit, return the exit value. If wait-status instead indicates death by signal, return 128 plus the signal number.
This function is prototyped to take a single scalar argument.
waitstat_die wait-status program-name
die() if wait-status is non-zero (mentioning program-name as the source of the error).
This function is prototyped to take two scalar arguments.
close_die filehandle name
Close filehandle, if that fails die() with an appropriate message which refers to name. This handles failed closings of both programs
and files properly.
This function is prototyped to take a filehandle (actually, a glob ref) and a scalar.
EXAMPLES
close SENDMAIL;
exit if $? == 0;
log "sendmail failure: ", waitstat $?;
exit EX_TEMPFAIL;
$pid == waitpid $pid, 0 or croak "Failed to reap $pid: $!";
exit waitstat_reuse $?;
$output = `some-program -with args`;
waitstat_die $?, 'some-program';
print "Output from some-process:
", $output;
open PROGRAM, '| post-processor' or die "Can't fork: $!";
while (<IN>) {
print PROGRAM pre_process $_
or die "Error writing to post-processor: $!";
}
# This handles both flush failures at close time and a non-zero exit
# from the subprocess.
close_die PROGRAM, 'post-processor';
AUTHOR
Roderick Schertler <roderick@argon.org>
SEE ALSO
perl(1), IPC::Signal(3pm).
perl v5.8.8 1999-10-27 WaitStat(3pm)