Tag Archives: HH

Help with touch: bad time specification

By N1a_Raider

Here is the part of the script: I have modified the file name.:)

SSFILE=${My_HOME_DIR}/log/my_file_ss.log
export MM=`date ‘+%m’`
export DD=`date ‘+%d’`
export HH=`date ‘+%H’`
export MIN=`date ‘+%M’`
export HOURAGO=`echo ${HH} -1 |bc `
echo $HOURAGO
export TTIME=${MM}${DD}${HOURAGO}00
echo $TTIME
touch -t ${TTIME} ${SSFILE}
export MIN=`date ‘+%M’`
export HOURAGO=`echo ${HH} -1 |bc `
echo $HOURAGO
export TTIME=${MM}${DD}${HOURAGO}00
echo $TTIME
touch -t ${TTIME} ${SSFILE}

I get this message in error log file: touch: bad time specification
I have solaris 10 and this is .ksh file.

Can anyone tell me what is wrong with this commands?

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Regular expression for something or nothing

By Michael Stora

I have some data files of the format HH:mm MM-DD-YY.
A frequent human error in the data is a technician entering YYYY instead of YY

Reg Expression 1:
[0-2][0-9][0-5][0-9] [0-1][0-9]-[1-3][0-9]-[0-9][0-9]

Reg Expression 2:
[0-2][0-9][0-5][0-9] [0-1][0-9]-[1-3][0-9]-20[0-9][0-9]

How can I create one expression? [,20] does not seem to work. This RE does not give an error but does not match any files:
[0-2][0-9][0-5][0-9] [0-1][0-9]-[1-3][0-9]-[,20][0-9][0-9]

Mike

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Perl failure with "main::$fn" used only once:" in error logs

By bashily

Hi all,

Can anyone guess why this is happening? I am new to Perl, so please help me to fix this error:
– I have a static html file which calls the cgi-perl script.
HTML Code:

Code:


and my CGI-PERL code is:

Code:

#!/usr/bin/perl -w
# Read the standard input (sent by the form):
read(STDIN, $form, $ENV{'CONTENT_LENGTH'});
# Get the name and value for each form input:
@pairs = split(/&/, $form);
# Then for each name/value pair....
foreach $pair (@pairs) {
# Separate the name and value:
($name, $value) = split(/=/, $pair);
# Convert + signs to spaces:
$value =~ tr/+/ /;
# Convert hex pairs (%HH) to ASCII characters:
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
# Store values in a hash called %FORM:
$form{$name} = $value;
}
#This will generate XHTML-compliant page headers
sub start_html()
{
print qq~

~;
}

if ($form{'submit'} eq "submit")
{
#Start hearders
print "Set-Cookie: name=$form{'name'}n";
print "Content-Type: text/htmlnn";
#end of headers
&start_html();
print "Nice to meet you $form{'name'}", ". I hope to see you again soon";
}
else
{
$old_cookie = $ENV{"HTTP_COOKIE"};

#if cookie was found
if ($old_cookie)
{
($cookie_name, $name) = split(/=/, $old_cookie);
#start headers
print "Content-Type: text/htmlnn";
#end of ...read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Air Methods Receives $44.8 Million Helicopter Contract

By Rich Duprey, The Motley Fool

Filed under:

Air medical transport specialist Air Methods announced yesterday it had received a contract worth $44.8 million from Sikorsky Aircraft to help modernize the U.S. Army’s air ambulance fleet.

Beginning in the first quarter of 2013 and running through the fourth quarter of 2017, Air Methods‘ United Rotorcraft division will provide Medevac interior systems to Sikorsky, the helicopter manufacturing subsidiary of United Technologies , which will install the systems on its new HH-60M Black Hawk helicopters.

United Rotorcraft President Tom Curtis said, “Our medical interior system provides the crew the ability to secure the patient and provide advance care. Additionally, the system can convert from one configuration to another in a matter of minutes, which maximizes the effectiveness, utility, and overall value of the HH-60M helicopter.”

The Medevac interior systems include a patented patient loading system, an on-board oxygen generation system, medical suction, electrical power for medical equipment, and high-intensity, night-vision-goggle-compatible lighting.

With more than 3,000 Black Hawk helicopters operating in 27 countries today,Sikorsky says they have amassed more than 9 million flight hours. Black Hawk helicopters flown by the Army in Iraq and Afghanistan have accumulated more than 1 million fleet flight hours, according to Sikorsky.

link

The article Air Methods Receives $44.8 Million Helicopter Contract originally appeared on Fool.com.

Fool contributor Rich Duprey has no position in any stocks mentioned. The Motley Fool recommends Air Methods. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.

Copyright © 1995 – 2013 The Motley Fool, LLC. All rights reserved. The Motley Fool has a disclosure policy.

(function(c,a){window.mixpanel=a;var b,d,h,e;b=c.createElement(“script”);
b.type=”text/javascript”;b.async=!0;b.src=(“https:”===c.location.protocol?”https:”:”http:”)+
‘//cdn.mxpnl.com/libs/mixpanel-2.2.min.js’;d=c.getElementsByTagName(“script”)[0];
d.parentNode.insertBefore(b,d);a._i=[];a.init=function(b,c,f){function d(a,b){
var c=b.split(“.”);2==c.length&&(a=a[c[0]],b=c[1]);a[b]=function(){a.push([b].concat(
Array.prototype.slice.call(arguments,0)))}}var g=a;”undefined”!==typeof f?g=a[f]=[]:
f=”mixpanel”;g.people=g.people||[];h=[‘disable’,’track’,’track_pageview’,’track_links’,
‘track_forms’,’register’,’register_once’,’unregister’,’identify’,’alias’,’name_tag’,
‘set_config’,’people.set’,’people.increment’];for(e=0;e<h.length;e++)d(g,h[e]);
a._i.push([b,c,f])};a.__SV=1.2;})(document,window.mixpanel||[]);
mixpanel.init("9659875b92ba8fa639ba476aedbb73b9");

function addEvent(obj, evType, fn, useCapture){
if (obj.addEventListener){
obj.addEventListener(evType, fn, useCapture);
return true;
} else if (obj.attachEvent){
var r = obj.attachEvent("on"+evType, fn);
return r;
}
}

addEvent(window, "load", function(){new FoolVisualSciences();})
addEvent(window, "load", function(){new PickAd();})

var themeName = 'dailyfinance.com';
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24928199-1']);
_gaq.push(['_trackPageview']);

(function () {

var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') …read more
Source: FULL ARTICLE at DailyFinance

awk Help: Horizontal to Veretical print with pattern match

By rveri

Hi AWK Experts,

Following is the data :

Code:

BRH113 DD AA HH CA DD DD AA HH BRH091 A4 A6 AH H7 67 HH J8 9J BRH0991 AA D8 C23 V5 H7 BR2 BRH991 AA HH GG5 BT0 JJ0


I want the output to be alligned with the pattern matching “BRH” inthe line.

The output should be look like:
A] Output:

Code:

BRH113 DD AA HH CA DD DD AA HH
BRH091 A4 A6 AH H7 67 HH J8 9J
BRH0991 AA D8 C23 V5 H7 BR2
BRH991 AA HH GG5 BT0 JJ0


B] Output:

Code:

BRH113 BRH091 BRH0991 BRH991
DD AA AA AA
AA A6 D8 HH
HH AH C23 CG5
CA H7 V5 BTO
DD 67 H7 JJO
DD HH BR2
AA J8
HH 9J


Can we do it with awk, or other unix tool,

Thanks a lot,
Reveri.

Source: FULL ARTICLE at The UNIX and Linux Forums

How to combine 2 texts file and create another file from it?

By type8code0

Hi all,

I’ve the following hostnames & ip addresses saved in host_ip.txt

Quote:

H1 1.1.1.1
H2 2.2.2.2
H3 3.3.3.3
….
H99 99.99.99.99


Based on this list, I need to create the following script.

Quote:

create host_plain HH
modify network_objects HH ipaddr XXXX
update network_objects HH


where by HH is a hostname
and XXXX is an ip address

So the final output would be something like this.

Quote:

create host_plain H1
modify network_objects H1 ipaddr 1.1.1.1
update network_objects H1

create host_plain H2
modify network_objects H2 ipaddr 2.2.2.2
update network_objects H2

create host_plain H3
modify network_objects H3 ipaddr 3.3.3.3
update network_objects H3

….

create host_plain H99
modify network_objects H99 ipaddr 9.9.9.9
update network_objects H99


Currently, I’m doing it manually, replace, copy and paste. Since there are hundreds of Hosts & IP Addresses, I really appreciate if someone could help me to automate this task using a script or any methods. Thanks in advance

Source: FULL ARTICLE at The UNIX and Linux Forums

Verify the header and trailer in file

By mirwasimplease see my requirement, I hope I am clear.

in a directory there are many file.now I want to write a script which will verify the headed trailer of a file
and verify count in triler with the count of file

let me show you how we verify manully

Code:
head -1 filename
HH2012122415091600009547This is the usage/nonusage extract file for MICA from infranet

Code:
tail -1 filename
TT201212241509160000954702100000This is the usage/nonusage extract file for MICA from infranet

Code:
wc -l filename
2100002 filename
NOw here

Code:
header HH2012122415091600009547 = TT2012122415091600009547
we also need to check whether header has HH and trailer has TT

Code:
in trailer 02100000 = 2100002 -2 (because this 2 is from header and trailer which need to be excluded)

Source: The UNIX and Linux Forums