Questions tagged [posix-compliant]

11 questions
188
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 + ). 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,673
  • 4
  • 29
  • 33
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
  • 1
  • 2
4
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
  • 809
  • 7
  • 18
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,731
  • 3
  • 24
  • 47
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
  • 103,293
  • 19
  • 273
  • 492
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…
vico
  • 4,447
  • 20
  • 55
  • 87
0
votes
1 answer

Why sigset includes unadded SIGINT?

Wrote simple program to learn writing POSIX style signal handling. #include #include #include #include static void sig_int(int); int main(void) { sigset_t waitmask; if (signal(SIGINT, sig_int)…
Bulat M.
  • 841
  • 4
  • 14
  • 32
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…
Sneakatoo
  • 25
  • 3
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
  • 4
-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…
pvorb
  • 101
  • 2