[问题]帮忙转2个数字成16进制

sh/bash/dash/ksh/zsh等Shell脚本
回复
rucstudent
帖子: 633
注册时间: 2007-05-09 16:52

[问题]帮忙转2个数字成16进制

#1

帖子 rucstudent » 2008-04-14 16:57

1280
768
请帮忙把上面2个数字转成16进制的把
因为打CS要宽屏,但是是16进制的,我不知道该怎么转...
rocky22
帖子: 684
注册时间: 2008-02-17 22:29
来自: 江苏

#2

帖子 rocky22 » 2008-04-14 16:59

1280: 500(H)
768: 300(H)
头像
carbont
帖子: 3406
注册时间: 2007-11-22 10:20
来自: 北京

#3

帖子 carbont » 2008-04-14 17:05

用科学计算器换一下就知道了。ubuntu系统自动安装的就行。
lenovo Thinkpad R60i 0657 LHC
windowsXP……准备换回ubuntu了。

Twitter: @carbont
头像
liupingjing
帖子: 451
注册时间: 2007-11-29 17:31

#4

帖子 liupingjing » 2008-04-14 18:27

我刚做了个数据转换器(其实没技术可言,在学gtk,拿来练手),要的话发给你
头像
chattan
帖子: 3922
注册时间: 2007-07-11 20:59
联系:

#5

帖子 chattan » 2008-04-14 19:04

这个和Ubuntu新手无关吧!,移到灌水去!
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#6

帖子 oneleaf » 2008-04-16 11:37

echo "1280 768" |awk {'printf "%x,%x",$1,$2'}
头像
stlxv
论坛版主
帖子: 8275
注册时间: 2006-05-03 0:39
来自: المريخ

#7

帖子 stlxv » 2008-04-16 21:37

oneleaf 写了:echo "1280 768" |awk {'printf "%x,%x",$1,$2'}
...麻烦

自带的计算器是最方便的方法
PHP是最好的语言!不服来战!
头像
yaoms
帖子: 4952
注册时间: 2007-10-19 14:51
来自: 深圳

#8

帖子 yaoms » 2008-04-17 10:24

oneleaf 写了:echo "1280 768" |awk {'printf "%x,%x",$1,$2'}
经典,有这个方法:

代码: 全选

printf "%x, %x\n" 1280 768
更简单,哈哈抢了老大的风头。

移到 shell区 :arrow: :roll:
Nothing 有事请发邮件到 yms541 AT gmail.com
alias 爱慕颇雷尔='mplayer'
zlowly
帖子: 83
注册时间: 2006-04-04 1:15

#9

帖子 zlowly » 2008-04-17 11:11

1280/16=80余0
80/16=5余0
500(HEX)

768/16=48余0
48/16=3余0
300(HEX)
回复