POSIX is an acronym for "Portable Operating System Interface", a family of standards specified by the IEEE for maintaining compatibility between operating systems.

learn more… | top users | synonyms

0
votes
0answers
14 views

Getting CRC mismatch warnings in gdb on cygwin

When I run any program under gdb in cygwin shell I get following warnings... warning: the debug information found in "/usr/lib/debug//usr/bin/cyggcc_s-seh-1.dll.dbg" does not match ...
4
votes
1answer
65 views

Is there a command line tool to manage unix signals?

Is there a command runner like env, nice, nohup, etc., that can run a program with modified signals? In my case, I need something to reset SIGINT to SIG_DFL. Why do I need this? Because ...
8
votes
1answer
192 views

What is the point of using multiple exclamation marks in sed?

POSIX sed documentation said: A function can be preceded by one or more '!' characters, in which case the function shall be applied if the addresses do not select the pattern space. Zero or ...
0
votes
2answers
44 views

Grep for regex in basename but return wholename

So say I have a list of files in a text file: ... /foo/barfoo /bar/foo/foobar /foobar/bar/foo ... I have a script that will search through this text file and, much like the locate command, I want ...
4
votes
1answer
31 views

Posix command that moves cursor to specific position in terminal window

in school we have been assigned a homework in which we are suppose to print an ascii art into a terminal window. A input is data in format [x_coordinate, y_coordinate, char_ascii_value] (there is no ...
2
votes
1answer
53 views

POSIX shell scripting and performance tuning [closed]

Nowadays, I'm researching for performance tuning for shell scripting , And I have been prevented to POSIX shell scripting, However it's only a standard, But I think it's rathar than standard for do ...
4
votes
1answer
57 views

What are the 'n', 'l', '3pm' sections of the manual for?

An excerpt from the man man page: The default action is to search in all of the available sections following a pre-defined order ("1 n l 8 3 2 3posix 3pm 3perl 5 4 9 6 7" by default) What are ...
1
vote
1answer
32 views

read reading input devided by spaces

How can I read in POSIX bash input like this: <name>,<tag1> <tag2> <tag3>… I tried while read line;do done but this wants newlines, all I have is spaces. (Is IFS solution? ...
2
votes
1answer
68 views

uname -n vs hostname

What is the difference between uname -n and hostname? Are there any real differences in what they return? Are there any differences in availability on different OSes? Is one of them included in POSIX ...
3
votes
3answers
59 views

When to use XPG* version of a command?

I occasionally do work on an older Solaris machine whose default version of grep is non-POSIX-compliant. This causes problems in my rc files because the default grep on the machine doesn't support ...
2
votes
1answer
58 views

I have a multi-line string that I need to iterate over, but I'm not using bash. Advice?

I'm using Dash because this is to run on my rPi. Bash is not an option. I'm rewriting a Bash script to work with Dash. I'm hoping to make it as POSIX-compliant (portable) as possible. The thing is ...
2
votes
1answer
50 views

Order between options and operands?

When using a utility program, we may specify options (and their option arguments) and/or operands. In most cases (in the sense of conforming to some standard (POSIX?)) does the order between ...
1
vote
1answer
92 views

Will `mv` ever have the ability to create directories?

This question asks for the best way to create a directory when using mv if it doesn't exist. My question is why isn't this an inbuilt feature of mv? Is there some fundamental reason due to which this ...
1
vote
1answer
73 views

Multithreading in Mail server (Postfix)

I need to perform multithreading on postfix mail server. I read about POSIX multithreading but could it be linked to postfix smtp server and if yes then how? System Specification: ubuntu 14.04 LTS and ...
1
vote
1answer
54 views

What, as examples, can produce a POLLNVAL?

The reference about poll() just says “The specified fd value is invalid. This flag is only valid in the revents member; it shall ignored in the events member.”. That's not clear (at least to me): if ...
3
votes
0answers
51 views

find printf switch POSIX alternative

I'd like to rewrite these 2 command so they will use only POSIX-complaint switches: find "$TARGET_DIR" -maxdepth 1 -type d -printf '(DIR) %f\n' find "$TARGET_DIR" -maxdepth 1 -type f -printf '%s %f ...
1
vote
0answers
54 views

OS X Yosemite is SUS - Single Unix Specification 3 certified. But what posix standard is it compliant to? the latest one is 2008

I'm confused. Is SUS compliance the same as POSIX compliance? Is yosemite compliant to the latest standards, what years exactly?
9
votes
4answers
1k views

Use #!/bin/sh or #!/bin/bash for Ubuntu-OSX compatibility and ease of use & POSIX

I know that I can use either as the first line of scripts to invoke the desired shell. Would #!/bin/sh be recommended if compatibility with all unix systems is an absolute requirement? In my case ...
0
votes
0answers
42 views

POSIX description of cp -R

I just became really confused by the implementation of bash's cp -R command compared to how POSIX words what should happen Given the posix definition, I would expect cp -R srcDir existingDestDir to ...
5
votes
1answer
153 views

Why does 'find -exec cmd {} +' need to end in '{} +'?

Preface: I understand the difference between -exec {} \; & -exec {} +. I also don't have a problem as such, I am just curious about the semantics of find. When ending the -exec argument with + ...
0
votes
1answer
36 views

Is field splitting and filename expansion turn off in RHS of variable assignment portable?

In most POSIX compliant shell like bash. ksh, dash, mksh, pdksh, when variable assignment occur, field splitting and filename expansion (and brace expansion if the shell supports) are not performed in ...
-2
votes
1answer
151 views

Regular expression in unzip files argument not working

I'm trying to view the contents of a zip archive using an extremely simple regular expression. This works: rmorton@Rockette:~$ unzip -l Downloads/WeiDU-Linux-236.zip "*/i386/tolower" "*/i386/weidu" ...
34
votes
7answers
2k views

Is test or [ or [[ more portable both between bash shells and between other shells?

I see I can do $ [ -w /home/durrantm ] && echo "writable" writable or $ test -w /home/durrantm && echo "writable" writable or $ [[ -w /home/durrantm ]] && echo ...
1
vote
1answer
183 views

open() return new file descriptor posix [closed]

I have to set the return values for open() in posix. How do I return "the new file descriptor" as it is said in the Linux man pages: RETURN VALUE open(), openat(), and creat() return the new ...
2
votes
2answers
319 views

Is there a specific reason why iptables would return an exit code of 3 (instead of 1?) when executed without sufficient privileges?

I simply forgot to use sudo: usr@arch ~[0] $ iptables -L iptables v1.4.21: can't initialize iptables table `filter': Permission denied (you must be root) Perhaps iptables or your kernel needs to be ...
3
votes
2answers
54 views

How is it possible to execute a command with an unknown number of arguments in a POSIX shell?

I want to search for multiple words inside the current directory. To accomplish this I use something like this. grep -e "word1" -e "word2" -R . This works fine. Taking this one step further, I ...
2
votes
1answer
95 views

Single or double brackets and portability

I have found some very good answers here on the differences between [ and [[ in 'if' statements. For specific named shells, it seems to be a good idea to use [[ over [ (and it is faster, too). I'm ...
3
votes
1answer
612 views

Consequences of setting up POSIX locales

Small background of the situation: We are using several UBUNTU servers having English as working language; however having en_US locale set in machines we encounter problems with apt-cacher-ng ...
2
votes
1answer
95 views

Process IDs range

On GNU/Linux system I seen only positive PIDs, but when kernel panic occured I seen info about process with PID=0. What's it? On Minix 3 I seen processes with negative PIDs. Minix is POSIX-compatible ...
10
votes
1answer
304 views

regarding portable sed -e… d b or ! b?

In this edit Stéphane Chazelas POSIXifies (again) my sed formatting by inserting an -expression break and another -expression statement. Now, I might just ask him why in the comments, I suppose, but ...
23
votes
1answer
983 views

When and how was the double-dash (--) introduced as an end of options delimiter in Unix/Linux?

I don't think the shell/utilities in historical Unix nor in something as "recent" as 4.4BSD supported using a double-dash(or two consecutive hyphens) as an end of options delimiter. With FreeBSD, you ...
3
votes
3answers
239 views

Interactive command usage reference: do you generally have that on Unix?

The question of why some commands rely on manpages whereas others rely on something like the --help flag for providing command usage reference is not new. There is usually a difference in scope ...
6
votes
1answer
212 views

Does Posix require any devices?

Does Posix require any devices? For example, /dev/urandom, /dev/zero or /dev/null? I suspect not because of non-*nix OSes, but wanted to ask for completeness.
2
votes
1answer
770 views

Removing non-printable characters using POSIX sed

Files created with roff and other "old-school" tools (for example man pages on many Unix systems) generate bold and underlined text in minimalistic terminals using tricks involving non-printable ASCII ...
7
votes
3answers
401 views

`/proc/$PID/cwd` : is there a POSIX equivalent?

Linux has a /proc directory and file‑system, which as far as I can tell, is not part of POSIX. In each /proc/$PID subdirectories, is a symbolic link, cwd, pointing to the actual working directory of ...
2
votes
1answer
4k views

How do I use grep to find a text string in files in sub folders of a parent folder without -r switch

I'm using Solaris 10 and have two grep versions one in /usr/bin and one in /usr/xpg4/bin. I have been searching for an answer on how to search for text within files within sub folders of a parent ...
25
votes
7answers
2k views

What's the difference of the Userland vs the Kernel?

I am trying to understand exactly what is userland? everyone that I ask says: "Anything that is not kernel". but it is not tangible for me. When I am reading that kernel can run that driver on the ...
3
votes
4answers
211 views

Protected environment variables?

Are there names of environment variables that cannot be overwritten by the user/a call to setenv? As I understand from POSIX1.2008, any process may edit the environment block, but must avoid ...
18
votes
2answers
539 views

explanation on chown(1) POSIX spec

The POSIX spec for the chown utility mentions in its rationale section about the chown user:group syntax (formerly chown user.group) (emphasis mine): The 4.3 BSD method of specifying both owner ...
5
votes
2answers
277 views

How exactly does `if $cmd ; then $cmd ; fi` differ from `$cmd && $cmd`?

In an answer to another very good question I made the following assertion: According to my reading of the POSIX specs, the use of one or the other makes no difference from a parsing standpoint. ...
2
votes
2answers
137 views

bash completion in Posix mode

I would like to use an interactive Posix bash shell but the autocomplete feature doesn't work. When I type the Tab character it simply prints a tab. The tab completion works only when I'm in a ...
0
votes
1answer
368 views

bash completion on posix mode [duplicate]

I would like to use an interactive posix bash shell but the autocompletion feature doesn't work. When i type the tab character it simply prints a tab. The tab completion only works when i'm on a non ...
5
votes
1answer
218 views

Where is $_ defined by POSIX?

In the comments to the accepted answer to this Unix & Linux StackExchange question, it is stated that $_ is "one of only some 7 special parameters defined by POSIX". I can't find that definition ...
10
votes
2answers
1k views

Is it OK to use “.” to run files instead of source - in .bashrc in Ubuntu and OS X?

OK, so source runs the script in the current shell and . separately, as detailed in running script with ". " and with "source " for example, but, specifically, in my .bashrc file, ...
2
votes
2answers
382 views

Is the double dash still the posix standard for long switches?

I've read several question about double dash: Single dashes - for single-character options, but double dashes -- for words? What does -- (double-dash) mean? (also known as “bare double dash”) ...
11
votes
5answers
2k views

What is meant by “a system call” if not the implementation in the programing language?

I would like to understand the term "system call". I am familiar that system calls are used to get kernel services from a userspace application. The part i need clarification with is the difference ...
6
votes
2answers
346 views

Which is the most portable of sed, awk, perl and sh?

Can someone put these tools in order of portability? Which of these is certain to be found on even the most minimal *nix systems? Is any of them 100% sure to be present? My guess is that the order is ...
5
votes
3answers
417 views

Are there “esoteric” (weird) but standards-compliant C compilers or runtimes?

As we know, the C standard does not specify a lot of details of the implementation, for example value of NULL pointer, order of bits and bytes (endiannes), alignment in structs and of stack ...
22
votes
4answers
1k views

Is the shell permitted to optimize out useless terminating commands?

If a shell is asked to perform a probably useless (or partially useless) command known to terminate, such as cat hugeregularfile.txt > /dev/null, can it skip that command's execution (or execute a ...
1
vote
1answer
370 views

Plain vi (not vim): Can't delete a line in insert mode: Is this behavior required by POSIX?

In the non-vim implementations of vi I've worked with, it's not possible to delete a line while in insert mode. vim does allows it—but it's my understanding that vim is not POSIX-compliant in ...