You are not logged in.
Hi guys. Ive started with bash some months ago and i wrote some useful Programs
So here is what i need:
printf "%x\n" DECIMALNUMBER Converts from decimal to hex
printf "%d\n" HEXNUMBER Converts from hex to Decimal
printf "%o\n" DECIMALNUMBER Converts from Decimal to OCTAL
printf "%o\n" HEXNUMBER Converts from Hex to OCTAL
My Question:
what is the command to convert FROM OCTAL to Decimal or Hex
Thank you
Offline
Just prefix the number with 0 (Zero), that will indicate to bash that its an octal number.
I've added an example to the page:
http://ss64.com/osx/printf.html
http://ss64.com/bash/printf.html
Offline
awesome man! you are great
Offline
sorry for double posting.
can i ask here another Question or should i open a new thread?
my question is:
i compare to files (FILE1 & FILE2) in therr are numbers
File 1: 19,18
File 2: 19,17
i use the command: cmp --verbose $FILE1 $FILE2 >>aim
in the aim file it says line 1(offset) and the number thats different 17
my question:
how can i read the number 17 out if the file? not the number one? only the number 17?
because i want to convert this number.
ok i know that its 17 but i want:
binarycompare
copy the results out of a File
convert the results
(Important for that is that i dont know the number of the results..
something like:
getnumber of=aim then printf "%d\n" 0+number in aimfile
any ideas?
do you understand me?
Offline