Questions tagged [posix-compliant]
11 questions
191
votes
4 answers
How to grep for tabs without using literal tabs and why does \t not work?
When I search for tabs in a file with (e)grep I use the litteral tab ( ^v + <tab> ). I can not utilize \t as a replacement for tabs in regular expressions. With e.g. sed this expression works very well. So is there any possibility to use a…
Lasall
- 3,733
5
votes
1 answer
In bash `$-` yields `himBHs` but `i` and `s` are invalid options -- what's going on?
$ echo $- himBHs $ set -h $ set -i bash: set: -i: invalid option set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...] $ set -m $ set -B $ set -H $ set -s bash: set: -s: invalid option set: usage: set [-abefhkmnptuvxBCHP] [-o…
Craig Hicks
- 849
- 9
- 20
5
votes
0 answers
stropts.h install for Ubuntu 20.01
I have just installed Ubuntu 20.04 and am trying to compile my pintOS project and it says stropts.h not found and I have researched a bit that it only works on Ubuntu 18.04. Someone share a way to compile my project by getting stropts.h file. I've…
Benny Joseph
- 51
3
votes
2 answers
How to skip a record with awk
I have a large number of files in a log-directory, whose names were time-stamped (in this case with date +%b[...] ). I want to write a POSIX compliant one-liner that will: either skip lines output from ls -ltc that have 2 fields or less (as seen by…
Cbhihe
- 2,809
3
votes
1 answer
What's the difference between `;` and space when setting environment variable before running a command
I've been wondering what's the difference between the two: CAROOT='certificates'; echo $CAROOT - prints the value, uses ; as separator between two commands CAROOT='certificates' echo $CAROOT - prints empty value. I wonder why the former command…
1
vote
1 answer
How compatible dash is with ksh?
Can I make /bin/sh symlinked to /bin/ksh instead of /bin/dash without breaking anything in the process ? Since they're both supposed to be POSIX-compliant, can I reasonably expect the replacement to go without issues?
Sergiy Kolodyazhnyy
- 107,880
1
vote
2 answers
list files or dirs starting with 'jre'
I need to list files and dirs with names starting with jre (small and capital letters are allowed). When I execute: ls | grep jre ...it greps just low capital letters and gives output with jre not only in start position. Actually I have feeling that…
vico
- 4,737
- 23
- 66
- 89
0
votes
1 answer
Why sigset includes unadded SIGINT?
Wrote simple program to learn writing POSIX style signal handling. #include <signal.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> static void sig_int(int); int main(void) { sigset_t waitmask; if (signal(SIGINT, sig_int) == SIG_ERR) {…
anon
0
votes
1 answer
Bash from scratch --again
As my journey through Bash goes on, I'm still stuck on ridiculous stuff such as this script I just can't wrap my head around on: #!/bin/bash if [ $1 -gt 100 ] then echo "You typed a larger number" if (( $1 % 2 == 0 )) then echo "And it's even an…
Sneakatoo
- 25
0
votes
1 answer
how to run an appimage app stored at a fat32 storage
As appimage aims to allow portability I was expecting something very similar to the apple .app format ( apple.application-bundle ) . I don't know how to launch an app from an appimage file stored in a fat32 USB (macOS allows it from its .app…
Daniel Perez
- 101
-1
votes
1 answer
Why doesn’t Ubuntu's `time` follow the standard POSIX format and how do I change it?
If you measure times in Ubuntu 18.04, the result apears in a single line: $ time sleep 1 sleep 1 0.00s user 0.00s system 0% cpu 1.003 total This doesn’t align with the POSIX standard, as described in time ’s man page: -p, --portability Use the…
pvorb
- 101