设为首页
收藏本站
用户名
Email
自动登录
找回密码
密码
登录
注册
快捷导航
平台
Portal
论坛
BBS
文库
项目
群组
Group
我的博客
Space
搜索
搜索
热搜:
shell
linux
mysql
本版
用户
LinuxSir.cn,穿越时空的Linuxsir!
»
论坛
›
Linux 综合讨论区 —— LinuxSir.cn
›
shell进阶应用、shell编程
›
shell编程想从文件中读入整型变量要怎么做 ...
返回列表
查看:
1230
|
回复:
3
shell编程想从文件中读入整型变量要怎么做
[复制链接]
ares99999
ares99999
当前离线
积分
6
IP卡
狗仔卡
发表于 2006-9-24 00:30:50
|
显示全部楼层
|
阅读模式
cat file | while read intValue
do
if [ "$intValue" -ge 20050909]]
then
printf "%d" "$intValue"
fi
done
file内容:
200053459 int.i
347832434 ci.d
.......
....
回复
使用道具
举报
提升卡
置顶卡
沉默卡
喧嚣卡
变色卡
显身卡
zq97
zq97
当前离线
积分
58
IP卡
狗仔卡
发表于 2006-9-24 08:57:31
|
显示全部楼层
for intValue in `awk '{print $1}'`;do
if [ ${intValue} -ge 20050909 ];then
echo ${intValue}
fi
done
回复
支持
反对
使用道具
举报
显身卡
寂寞烈火
寂寞烈火
当前离线
积分
533
IP卡
狗仔卡
发表于 2006-9-24 12:41:50
|
显示全部楼层
while read a b;do [[ $a -ge 20050909 ]] && echo $a;done<urfile
复制代码
回复
支持
反对
使用道具
举报
显身卡
davi
davi
当前离线
积分
142
IP卡
狗仔卡
发表于 2006-9-24 23:05:52
|
显示全部楼层
awk '$1>=20050909{ print $1 }' file
回复
支持
反对
使用道具
举报
显身卡
返回列表
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
注册
本版积分规则
发表回复
回帖后跳转到最后一页
浏览过的版块
Archlinux讨论区
Linux 程序设计专题讨论
Linux 输入开发与研究
开源软件专题讨论
Copyright © 2002-2023
LinuxSir.cn
(http://www.linuxsir.cn/) 版权所有 All Rights Reserved.
Powered by
RedflagLinux!
技术支持:
中科红旗
|
京ICP备19024520号
快速回复
返回顶部
返回列表