FWIW, $(( X + 5 )) is 100% POSIX. Especially if shell code is to be used in a mixed environment I would suggest to limit oneself to what is specified by POSIX. The fact that /bin/sh may point to different shells, does not matter, for /bin/sh points to a POSIX compliant shell, so your code will most probably run there.
If you require more advanced features then another option would be to use ksh93 which is also available on many systems and still is the most advanced shell IMHO (and also very fast). You could also use bash if that that is available...
A well known exception is Solaris, which still uses a classic Bourne shell as /bin/sh
Not any more. Nothing in the POSIX standard requires the compliant shell to be in /bin, this fact and the requirement for third party legacy scripts not to break explains why Solaris kept the original Bourne shell there for such a long time. However, this annoyance has been removed in Solaris 11 which provides ksh93 as /bin/sh.
Thanks, Solaris 11 seems quite interesting, I got me some DVD's. Do you know if the utilities (awk, sed, grep etc) now also default to a POSIX version?
No, unlike with sh, changing these /usr/bin utility would break too much third party existing scripts.
What is new with Solaris 11 is that the GNU version of these utilities are available in /usr/bin prefixed by "g", ex: /usr/bin/gawk, gsed, ggrep so if you need them, you can use their explicit name in scripts without clashing with the default ones.
Should you want to use existing scripts that expect these utilities to support Gnuisms without the "g" prefix, like most of what the Gnu/Linux community produce, you can simply prepend /usr/gnu/bin: to your PATH.
As with all modern Unixes (including Gnu/Linux), if you write portable POSIX scripts, you just need to run this command before launching the script:
or, in unknown environments:
In such case, your shell scripts must have no shebang in the first line for themselves to be run by the POSIX compliant shell. Most people wrongly think #!/bin/sh is the correct way.
Hi,
Unable to make tape backup, please help.
/opt/ignite/bin/make_tape_recovery -a /dev/rmt/?mn -I -v -m tar -x inc_entire=vg00
* Creating local directories for configuration files and archive.
======= 04/25/16 16:28:08 IST Started /opt/ignite/bin/make_tape_recovery.
(Mon... (4 Replies)
How to provide a client exclusive access to the NTP device or NTP server.
Example:
1. Configured md5 authentication for a subnet added below restriction line to the subnet as below in ntp.conf file. Also configured the keys and md5 authentication working .
restrict 192.168.1.0 mask... (1 Reply)
I cannot access or boot from my C drive. I'm running Zorin 9 and the drive is a Samsung SSD. The disk was encrypted on install, and that has not given me any problems before.
When I start the system it gets to the memory test page, and does not then load the password prompt, which it used to.... (1 Reply)
Equipment: DJI Phantom 3
I have the root and passwords access, but I cannot find out how to access the equipment.
There is a USB port going to a miniUSB that connects to the equipment, but on Windows is detecting the connection as being a Serial Port (COM3).
I need some help in order to gain... (5 Replies)
I am trying to load into the kernel a system-call dynamically (without restarting the kernel and compailing it) in an attempt to (once in kernel mode) write to user process's memory.
(I know there is a way to do this with the ptrace interface but it is not an option.)
I know the only way to... (1 Reply)
hi, i am on a quest to access and even mount if possible a drive on os x. there is no driver for the device, but it lists fine in the system profiler. can i access its location from the terminal? how? here is what i get on the system profiler:
Speed: Up to 480 Mb/sec
Manufacturer: SAMSUNG
... (3 Replies)
Problem statement.
In this part of the assignment, delegates will create a pseudo-device and write a device driver for it. The pseudo-device provides a “backdoor” for gaining root access for a particular user. Instead of compiling the device driver into the kernel, delegate will create a module.... (1 Reply)
Hello everyone,
I write a program (Linux & Solaris) that will run as non-root user, but the program must have rw access to a device /dev/ipmi (on linux) or /dev/bmc (on solaris).
What is the standard way of granting such access?
Linux:
chmod on /dev/ipmi ?
suid root my program?
Solaris:... (1 Reply)
Hi,
we have running 8 box sles 9 cluster and on an nfs filesystem we have the problem which is grepped from /var/log/messages.
Jun 8 13:40:46 qnclpx02 kernel: attempt to access beyond end of device
Jun 8 13:40:46 qnclpx02 kernel: sdat: rw=0, want=8894615912, limit=314572800
Is there... (1 Reply)
Hi,
I was wondering if any of you guys know of way to make applications that use sound device on linux to access it in a "non-exclusive manner", the aim is to be able to use more than one application that requires the sound device.
Thanks (0 Replies)