A sample shell script
#!/bin/sh
viperooe_home=`dirname $0`
source $viperooe_home/env-viperooe.sh
instancename=$1
cd $viperooe_home/persistence/$1
currentDate=`date '+%Y%m%d'`
echo $currentDate
currentTime=`date '+%H%M%S'`
echo $currentTime
logName=orderStoreRatio-$currentDate-$currentTime.log
echo here is it! $viperooe_home/$logName
echo "orderstore usage info:" >> $viperooe_home/$logName
typeset -i used=`od -c orderstore |grep 'c i b c' | head -1 | awk '{print $1}'`
echo "Currently used: $used" >> $viperooe_home/$logName
typeset -i total=`od -c orderstore |tail -1`
echo "Totally we have: $total" >> $viperooe_home/$logName
typeset -i ratio=used*100/total
echo "orderstore Usage ratio: $ratio%" >> $viperooe_home/$logName
how to define a string
Simply follow this way:
currentDate=`date '+%Y%m%d'`
echo $currentDate
Don’t use set like this:
set currentDate=`date '+%Y%m%d'`
echo $currentDate
Conclusion: It’s quite strange that, use keyword set, it doesn’t work. But if you call the above 2 lines directly in command line($) it works fine.
How to define a integer
typeset -i used=`od -c orderstore |grep 'c i b c' | head -1 | awk '{print $1}'`
分享到:
相关推荐
在本篇文章中,我们将深入探讨“C#变量-VariableDefinition”。 一、变量的定义 变量是程序中用于存储信息的内存位置。每个变量都有一个特定的数据类型,它决定了该变量可以存储的数据种类以及所占的内存大小。在C#...
Variable definition Ident ifier variables Country code 3-letter IS O country code country Country name curr ency_unit Currency unit year Year Real G DP, employment and population levels 内容 过多,...
Variable definition 变量定义 Identifier variables 3-letter ISO country code 3 个字母的 ISO 国家/地区代码 Country name 国家/地区名称 Currency unit 货币单位 Year 年 Real GDP, em ployment and ...
`data definition`、`variable definition`、`data calculation`分别用于指定数据源、创建变量以及执行数据计算。 1. `DEF`语句定义了从哪个RRD文件中提取特定DS(Data Source)的数据。`<vname>`是变量名,`...
* 中间函数以及变量定义:/*Define Definition*//*Structure Definition//*Function Definition*//*Variable Definition// (2)文件命名要求 文件名一般要求简短,一般建议不超过三个单词,单词与单词之间采用...
- 在主界面右下角的“Variable Watch”区域,右键点击“Create New Watched Var”以打开“Variable Definition”窗口。 - 在“Variable name”和“Address”字段中输入需要读取或写入的变量名(仅限全局变量)。 - ...
-- Variable definition: local a, b -- Initialization a = 10 b = 30 print("value of a:", a) print("value of b:", b) -- Swapping of variables b, a = a, b print("value of a:", a) print("value of b:", ...
18. **Variable Definition**:变量定义是指为变量赋值的操作。 #### 三、测试设计技术概述 IEEE29119-4标准定义了几种不同的测试设计技术,包括基于规格测试、基于结构测试和基于经验测试。这些技术各有侧重,共同...
random-ext(JavaScript随机扩展) random-ext是一个Node.js模块,它生成... stringPatternArray(length, pattern, variableDefinition) pick(array) shuffle(array) subArray(array) color() CHAR_TYPE boole
### PowerBuilder 7.0 参考手册精要解析 ...- **VariableDefinition对象**:用于定义变量。 通过学习这些对象及其属性、事件和函数,开发者可以充分利用PowerBuilder的强大功能来构建复杂的应用程序。
Go语言break语句 在Go编程语言中的break语句有以下两种用法: break语句用于在循环立即终止,程序控制继续下一个循环语句后面语句。 它可用于终止在switch语句的... /* local variable definition */ var a int =
VariableDefinition stV = new VariableDefinition(stT); method.Body.Variables.Add(stV); Instruction first = method.Body.Instructions.First(); il.InsertBefore(first, il.Create(OpCodes.Newobj, mD....
Variable definition has the same rule as this. # Type of arguments and returned value are deduced automatically. # If you want to specify the type of argument, you can use ':'. # e.g. # fun
VPRS looses the strict definition of approximate boundary in RST. Confident threshold value forβis discussed and the method for deriving decision-making rules from an information system is given by ...
--[local variable definition--] a = 10 --[repeat loop execution--] repeat print("value of a:", a) a = a + 1 until (a > 15) ``` 在这个例子中: - 首先定义了一个局部变量`a`并赋值为10。 - 进入`repeat....
HDMI(High-Definition Multimedia Interface)是一种高-definition 多媒体接口标准,用于连接设备之间的音频和视频信号传输。HDMI 协议 Version 2.1 是 HDMI 协议的最新版本,提供了更高的带宽和更好的音频和视频...
%ENV<variable_name>,<variable_value> G %INC, G CONTENTS http://docs.rinet.ru:8080/Using_Perl5_in_Web/ (8 of 24) [2/17/2007 1:22:35 PM] %SIG, G @ARGV G @INC G From Here... G Chapter 14 Operators ...
fs_variable.c contains all definitions of variables that can be shared with the all file systems. config.h must contain the definition of the file system used by your application.
Realizing high-sensitivity, low dark current, this sensor also has an electronic shutter function with variable storage time. (Application: Surveillance, FA cameras, Industrial cameras)
The IMX274LQC-C is a diagonal 7.20 mm (Type 1/2.5) CMOS image sensor with a color square pixel ...shutter function with variable storage time. (Application: Surveillance, FA cameras, Industrial cameras)