Tried printf(1)
?
printf "%x\n" 34
22
There are probably ways of doing that with builtin functions in all shells but it would be less portable. I’ve not checked the POSIX sh specs to see whether it has such capabilities.
More Related Contents:
- Replace a string in shell script using a variable
- How to delete duplicate lines in a file without sorting it in Unix
- Identifying and removing null characters in UNIX
- Why do shell script comparisons often use x$VAR = xyes?
- Is there a Unix utility to prepend timestamps to stdin?
- Use grep –exclude/–include syntax to not grep through certain files
- Is PowerShell ready to replace my Cygwin shell on Windows? [closed]
- How do I set $PATH such that `ssh user@host command` works?
- How to do a mass rename?
- Date arithmetic in Unix shell scripts
- How do I manipulate $PATH elements in shell scripts?
- What is the general syntax of a Unix shell command?
- unix command line execute with . (dot) vs. without
- Diff files present in two different directories
- How do I change a shell scripts character encoding?
- Creating string of repeated characters in shell script [duplicate]
- In a unix shell, how to get yesterday’s date into a variable?
- Shell script “for” loop syntax
- In the shell, what does ” 2>&1 ” mean?
- How to run Unix shell script from Java code?
- What are file descriptors, explained in simple terms?
- What does “&” at the end of a linux command mean?
- Run java jar file on a server as background process
- Equivalent of *Nix ‘which’ command in PowerShell?
- Print lines in one file matching patterns in another file
- When to wrap quotes around a shell variable?
- Which terminal command to get just IP address and nothing else?
- Configure cron job to run every 15 minutes on Jenkins
- How to add text at the end of each line in unix
- Subtract two variables in Bash