delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

more timefile_2.txt
-rw-r--r--   1 root     other          0 Jun 21 17:13 test123.txt
-rw-r-----   1 sybase other   2096629760 Jun 24 10:01 hello.txt
-rw-r--r--   1 root     other          0 Jun 24 10:58 timefile_2.txt

*********************************************************
My aim is to capture the results (all 3 results) of the time command (I need to do some arithmetic calculations on the values)
I'm working on a
SunOS 5.9 Generic_112233-12 sun4u sparc SUNW,Sun-Fire-V440
server


I have a problem controlling the output from the UNIX time command, for some strange reason the "output" (specifically the last 3 lines of the output) seems like it can only be directed to the screen, no matter what I do:
Take for example I tried this:
bash-2.05#
( time ls -ltr) | tail -3 > timefile_1.txt
real    0m0.008s
user    0m0.000s
sys     0m0.010s

I then looked at the contents of the file
timefile_1.txt
and I saw this :
bash-2.05#
more timefile_1.txt
-rw-r--r--   1 root     other        201 Jun 24 10:58 abc123.txt
-rw-r-----   1 sybase   sybase   2096629760 Jun 24 11:01 tempdb_dev
-rw-r--r--   1 root     other          0 Jun 24 11:42 timefile_1.txt
**********************************************************
So I experimented some more :
bash-2.05# ( time ls -ltr) | tail -3 > timefile_2.txt 2>&1

real    0m0.009s
user    0m0.010s
sys     0m0.000s

As you can see below the last 3 lines of the
ls -ltr
command has been redirected to the
timefile_2.txt
file, I need the above 3 lines from the time command
bash-2.05#
more timefile_2.txt
-rw-r--r--   1 root     other          0 Jun 21 17:13 test123.txt
-rw-r-----   1 sybase other   2096629760 Jun 24 10:01 hello.txt
-rw-r--r--   1 root     other          0 Jun 24 10:58 timefile_2.txt
*********************************************************
My aim is to capture the results (all 3 results) of the time command (I need to do some arithmetic calculations on the values)
I'm working on a
SunOS 5.9 Generic_112233-12 sun4u sparc SUNW,Sun-Fire-V440
server

TOP

why are you doing 'tail -3'?
this works fine for me [ksh on Solaris 7] - capturing both the 'ls' and the 'time' in the same file.
(time ls -l) 1> /tmp/time 2>&1

TOP


Originally Posted by vgersh99
why are you doing 'tail -3'?
this works fine for me [ksh on Solaris 7] - capturing both the 'ls' and the 'time' in the same file.
(time ls -l) 1> /tmp/time 2>&1
I don't want to capture the output from the
ls -l
command only the
time
. Thanx though for your suggestion.
This is what works :
(time ls -ltr) 2> time.txt 1>/dev/null

TOP

I have another question....would it be possible for me to manipulate the output of the time command without first dumping it to file ? The thing is, I really don't want to create the time.txt file. What I would want to do is isolate the two numeric sections of the output and store them in variables var1 and var2 respectively (note that this would be done inside a loop inside a ksh script):
The following commands isolates the numeric portions of the output that I want :
bash-2.05#(time ls -ltr) 2> time.txt 1>/dev/null ; tail -3 time.txt | awk '{print $2}' | awk -Fm '{print $1,$2}' | awk -Fs '{print $1,$2}'
The output of the above command :
0 0.008
0 0.000
0 0.010
I would want to initially store 0 in var1 and 0.008 in var2 so I could do some other calculations.

TOP

abstract:

more timefile_2.txt
-rw-r--r--   1 root     other          0 Jun 21 17:13 test123.txt
-rw-r-----   1 sybase other   2096629760 Jun 24 10:01 hello.txt
-rw-r--r--   1 root     other          0 Jun 24 10:58 timefile_2.txt

*********************************************************
My aim is to capture the results (all 3 results) of the time command (I need to do some arithmetic calculations on the values)
I'm working on a
SunOS 5.9 Generic_112233-12 sun4u sparc SUNW,Sun-Fire-V440
server


Ok I think I figured out how to avoid writing the output to a file :
(time ls -ltr) 2>&1 1>/dev/null | tail -3  | awk '{print $2}' | awk -Fm '{print $1,$2}' | awk -Fs '{print $1,$2}'
Gives the following output :
0 0.009
0 0.000
0 0.010

TOP


Code:
  1. (time ls -ltr) 2>&1 1>/dev/null | tail -3 | sed 's/.*\([0-9][0-9]*\)m\(.*\)s$/\1 \2/'
Copy Code

TOP


Originally Posted by vgersh99
Code:
  1. (time ls -ltr) 2>&1 1>/dev/null | tail -3 | sed 's/.*\([0-9][0-9]*\)m\(.*\)s$/\1 \2/'
Copy Code
Hey thanx....that code seems better.

TOP

QQ:1248687676→→★【兴隆金融投资集团】
2010年巨献:【QQ:1248687676】 客服:罗莉
   放贷时间:(早上8:30---下午5:00)无休假日。

           
★★★【兴隆金融投资集团】2010年主要是面向本地区中小企业及个人,从事信贷融资及管理顾问服务,公司成立于2001 年,长期与三大银行(工行,农行,建行)合作,并建立了牢固亲密的合作关系,双方通过不断的业务往来,形成了良好的信誉基础。公司致力为企业和个人提供全面的贷款咨询及服务,通过专业的、个性化的、一对一的顾问式服务平台。

★一、贷款的标准和条件:手续简便=快捷=保密=安全=可靠!
1:个人贷款,放贷额度(1万-20万),贷款地区(本地区),1万起贷,期限1-2年,贷款利率:季度利率百分(3),年度利率百分(10),。
要求A)需提供本人有效证件(如身份证,户口本)复印件,一张二寸的彩照,及家庭详细地址,家庭固定电话或本人的固定联系电话。
要求B)公司同时要求申请人提交相关资料,对提交材料进行核实后并予以上报批款,最快半小时以内下款。

2:企业贷款:放贷额度(10万-50万),期限(1-3年)贷款利率:季度利率百分(3),年度利率百分(8-10)。
要求A)企业工商营业执照,税务登记证,组织机构代码证及法人代表身份证的复印件。
要求B)公司同时要求申请人提交相关资料,对提交材料进行核实后并予以上报批款,最快1-2天以内下款。

3:个体户贷款:放贷额度(5万-30万),期限(1-3年)贷款利率:季度利率百分(3),年度利率百分(10)。
要求A)工商营业执照,税务登记证,及身份证的复印件。
要求B)公司同时要求申请人提交相关资料,对提交材料进行核实后可在1小时内给予客户肯定回答是否批款,最快申请的第二天以内下款。


★二、贷款优点:如贷款不成功不收取任何费用。
1、还款方式优化(按季度还息,到期还本);
2、借款用途不限(可用做企业资金周转、购房、买车、装修、、教育等等);
3、贷款额度大,下款时间快,流程短;
4、可提前还贷,无违约金;
5、贷款期限长,手续快速、简便;
6、如贷款不成功不收取客户任何费用;


★三、贷款流程:
提交申请→审核资料→审核通过→签订合同→领取现金→到期还贷。

-

------公司特点:银行联网!放心可靠!安全保密!利息合适!贷款用途广!下款速度快!
额度大的客户可由公司保安免费开车护送或到银行转卡,以确保客户的经济安全。
公司承诺:信誉第一;服务第一;保密第一;顾客至上;诚信为本.

QQ:★★124 868 7676★★ 客服:罗莉
★╰★★╮╰★★╮╰★★╮╰★★╮╰★★╮╰★★╮╰★★╮╰★★╮╰★

★公 司 合 同★
贷款方:________________
地 址:________________
邮编:——————电话:_______________ 借款方:银行账号:______________________________
地 址:______________________________
邮编:______________ 电话:______________________
根据《中华人民共和国合同法》的规定,经贷款方、借款方、担保方协商一致,签订本合同,共同信守。
第一条贷款种类:____________________________________
第二条借款金额(大写):_____________________________________
第三条借款用途:________________________________________
第四条 借款利率:借款利率为季度息4,按季度收息,利随本清。
第五条 借款期限:
借款期限自____ 年____ 月____ 日起,至____ 年____ 月____ 日止。借款实际发放和期限以借据分1次发放和收回。借据应作为合同附件,同本合同具有同等法律效力。
第六条 还款资金来源及还款方式:
1.还款资金来源:______________________________________________
2.还款方式:______________________________________________
第七条 保证条款:
借款方请___________________作为借款保证方,经贷款方审查,证实保证方具有担保资格和足够代偿借款的能力,保证方有权检查和督促借款方履行合同。当借款方不履行合同时,由保证方连带承担偿还借款本息的责任。必要时,贷款方可以从保证方的存款帐户内扣收贷款本息。
第八条 违约责任:
1.签订本合同后,贷款方应在借款方提出借据1日内(假日顺延)将贷款放出,转入借款方帐户或由贷款方(银行)开出汇票发放给借款方。如贷款方未按期发放贷款(汇票),应按违约数额和延期天数的贷款利息的20%向借款方偿付违约金。
2.借款方如不按合同规定的用途使用借款,贷款方有权收回部分或全部贷款,对违约使用部分,按银行规定加收罚息。借款方如在使用借款中造成物资积压或损失浪费或进行非法经营,贷款方不负任何责任,并有权按银行规定加收罚息或从借款方帐户中收贷款本息。如借款方有意转移并违约使用资金,贷款方有权商请其他开户行代为扣款清偿。
3.借款方应按合同规定的时间还款。如借方需要将借款展延,应在借款到期前5日向贷款方提出申请,有保证方的,还应由保证方签署同意延长担保期限,经贷款方审查同意后办理延期手续。如借款方不按期偿还借款,贷款方有权限期追回贷款,并按银行规定收逾期利息和罚息。如企业经营不善发生亏损或虚盈实亏,危及贷款安全时,贷款方有权提前收回贷款。
第九条合同变更或解除:除《合同法》规定允许变更或解除合同的情况外,任何一方当事人不得擅自变更或解除合同。当事人一方依据《合同法》要求变更或解除合同时,应及时采用书面形式通知其他当事人,并达成书面协议,本合同变更或解除后,借款方占用的借款和应付的利息,仍应按本合同的规定偿付。
第十条 解决合同纠纷的方式,执行本合同发生争议。由当事人双方协商解决。协商不成,双方同意按( )项处理。
(1)由仲裁委员会仲裁。
(2)向人民法院起诉。
第十一条本合同经双方签字生效.
贷款方:______________________ 借款方:____________________
代表人签字:_________________ 代表人签字:____________________
保证方签字:_____________________
____年____月____日
      
    历史赋予我们的光荣职责,是把兴隆金融投资集团的事业不断推向前进,为客户提供优质的服务,为促进我国金融改革发展做出更大贡献。面对新的发展机遇和挑战,兴隆金融投资集团将以“三个代表”重要思想为指导,坚持科学发展观,与时俱进,开拓创新,稳健经营,规范管理,坚定不移地走高质量发展之路,努力建设资本充足、内控严密、运营安全、服务与效益良好的现代金融企业,相信用华夏人的智慧和勤奋必将为您的生活创造美好的未来!
  
  兴隆集团★:百度推广:
受理时间;8;30--17;00节假日不休息
  客      服:罗莉
  客服QQ:124 868 7676  
公司邮箱:1248687676@qq.com  
公司名称:兴隆金融投资集团
  ★广告编号(98578)283018278
    2004-2010  xinglong兴隆版权所有





more timefile_2.txt
-rw-r--r--   1 root     other          0 Jun 21 17:13 test123.txt
-rw-r-----   1 sybase other   2096629760 Jun 24 10:01 hello.txt
-rw-r--r--   1 root     other          0 Jun 24 10:58 timefile_2.txt

*********************************************************
My aim is to capture the results (all 3 results) of the time command (I need to do some arithmetic calculations on the values)
I'm working on a
SunOS 5.9 Generic_112233-12 sun4u sparc SUNW,Sun-Fire-V440
server

TOP

Back Forum