Is there a way that the Bash recognizes hex numbers in command lines?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Yes I did. About your finding, much more straightforward translate to base ten with my pocket calculator but thanks anyways. Indeed I looked into the bash man page. There are some references to hex base but none of them seemed to apply. By the way, LQ is not an oracle. Nor is it a developer's mailing list. It's just LQ [smiling face].
As far as the Shell Command Language is in concern, the primary source of information is not bash's manual but the Shell & Utilities volume of The Open Group Base Specifications Issue 7 aka the POSIX specification, of which bash is an implementation, plus extensions. Reading the specification it is clear that '0x1BE' is just a token for the shell, and that to interpret it as an hexadecimal number you need to submit it to an arithmetic expansion.
Last edited by Didier Spaier; 01-18-2015 at 06:47 AM.
so you've got a machine that understands? Lucky man
'bash is not an assembler': bash is the bulkiest language I've seen in my life. I the SEE ALSO section of the man page there are mentioned sh (1) and csh (1), but neither sh nor its man page are anywhere to be seen. Maybe in the first releases of slack there is one.
'bash is not an assembler': bash is the bulkiest language I've seen in my life. I the SEE ALSO section of the man page there are mentioned sh (1) and csh (1), but neither sh nor its man page are anywhere to be seen. Maybe in the first releases of slack there is one.
If you don't like bash, you may use another shell.
Type this:
Code:
ls -l /bin|grep sh$
You will see that actually Slackware ships no less than five shells, each whith its own man page.
Anyone uses what one wants and can get. Personally, I tend to stay POSIX compliant as much as possible and avoid extensions if that doesn't lead to something way too convoluted. That doesn't prevent me to use bash, but not all features of it. I am far to know all its features anyway but don't care.
Last edited by Didier Spaier; 01-18-2015 at 10:58 AM.
OK, now: Is sh, the Bourne shell, too old for slackware 14.0?
I don't know it it can be compiled on Slackware 14.0, but you could try this version (for Unix V7. That's the only one I was able to find).
EDIT. Actually, there's also this one. but I don't know if it differs from the genuine one, neither in what respect.
PS You might also want to have a look at this discussion. If I can trust what is said there, there can be two reasons for which the Bourne Shell or one of its close derivatives is not shipped in "Unix like" OS:
A license issue
That it be not POSIX compliant.
But at it seems logical that a POSIX compliant shell can be found from /bin/sh, this is usually a link to another shell (bash in Slackware's case).
Last edited by Didier Spaier; 01-18-2015 at 11:47 AM.
Reason: PS added.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.