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

1
vote
1answer
875 views

Disabling readahead with hdparm or POSIX_FADV_RANDOM

From Linux kernel's doc the advice POSIX_FADV_RANDOM seems to disable readahead. But whent I disable Readhead using (sudo hdparm -A 0 /dev/sdb) I get huge degradation in performances; also noticed ...
5
votes
1answer
996 views

A couple arithmetic related commands, Dash, POSIX shell, sh, Increment

When pre/post incrementing a variable, in POSIX Shell, what is the difference between these two examples. They seem like they would have the same consequences, but would they be used differently? ...
5
votes
4answers
547 views

Is there a difference between these two commands?

cat a > b and cp a b If they are functionally the same for all intents and purposes, which one is faster?
2
votes
2answers
278 views

find command for the newest 500 files in a directory tree and also be POSIX compliant

I am looking for a single line shell script or unix command to find the newest 500 files in a directory. Major constraints are it should be POSIX complaint and the directory can have tons of files.
7
votes
1answer
183 views

Does POSIX guarantee that the standard utilities are in PATH?

In the "Command Search and Execution" section, the POSIX specification says that PATH is searched when finding a utility to execute (with some exceptions). Does the specification mention anywhere ...
14
votes
2answers
940 views

Portability of “> /dev/stdout”

Occasionally I need to specify a "path-equivalent" of one of the standard IO streams (stdin, stdout, stderr). Since 99% of the time I work with Linux, I just prepend /dev/ to get /dev/stdin, etc., ...
0
votes
1answer
208 views

POSIX conformance: NetBSD 5.1 <sys/time.h> gettimeofday declaration

I'm compiling some code which requests POSIX 1003.1 1993 conformance via -D_POSIX_C_SOURCE=2. The code includes the header <sys/time.h> and wants to call gettimeofday, but on NetBSD 5.1 there ...
4
votes
3answers
212 views

Why is there a type for process ids (pid_t), but not for file descriptors (fd)?

I see that pid_t is typedef'd in unistd.h, and file descriptors are defined to be int in fcntl.h. But since they are used in similar ways, wouldn't it make sense to have a typedef for file ...
5
votes
1answer
432 views

A minimal POSIX conformant operating system

For educational purposes, I'd like to start with a POSIX compliant base, including a shell, basic utilities, and an ANSI C compiler, then see what kind of environments I can build by putting packages ...
0
votes
1answer
505 views

POSIX and Bash, sh shorthand, for compound if statement

I prefer to do my sh commands in shorthand, And I prefer to be in POSIX. Truthfully, if the script can run on Dash, that is good enough. Which means using the test command [, not the extended [[. I ...
4
votes
1answer
113 views

Why not just use standard streams instead of using filenames?

While I understand that programs like mv need an actual filename as a parameter, programs like sort could just read from standard input and write to standard output like names | sort > names ...
12
votes
2answers
1k views

Why do some applications use ~/.config/appname for their config data while others use ~/.appname?

I've noticed that some applications put their configuration files to ~/.config/appname while others use ~/.appname (the classic way, AFAIK) for this. What's the sense in this distinction and what ...
1
vote
2answers
710 views

Should I end my text/script files with a newline? [duplicate]

Possible Duplicate: What's the point in adding a new line to the end of a file? What is considered better behaviour: to leave the last letter of the last line to be the last byte of a ...
14
votes
3answers
596 views

Newlines in filenames

I understand and accept the premise that defensive1 shell scripting is both prudent and, in the longer term, more sustainable. Many of the answers to text processing questions here follow this ...
6
votes
2answers
382 views

Where can I find official POSIX and UNIX documentation?

I am looking for official documents on all POSIX standards and specifications. I would like to be able t read the docs to get a better understanding of UNIX systems and how they work at a low level. ...
1
vote
0answers
30 views

Open Group Base Specifications, Single UNIX Specification and POSIX [duplicate]

Possible Duplicate: What differences are between POSIX and Single UNIX Specification? Having asked about the relation between POSIX and Single UNIX Specification, I was now wondering what ...
22
votes
3answers
2k views

Difference between POSIX, Single UNIX Specification, and Open Group Base Specifications?

What are the differences between POSIX, the Single UNIX Specification, and the Open Group Base Specifications? I think their purpose is for determining if an OS is Unix?
39
votes
3answers
5k views

What exactly is POSIX?

I see POSIX mentioned often and everywhere, and I had assumed it to be the baseline UNIX standard.. until I noticed the following excerpt on a Wikipedia page: The Open Group The Open Group is ...
6
votes
1answer
688 views

What does 'uni' mean in unistd.h

What does uni mean in unistd.h Does it mean unix? or universal? What is it?
11
votes
2answers
2k views

How do I test to see if an application exists in $PATH?

I'm trying to write all of my sh startup/env scripts to work with as much DRY and as much: "works on every *nix I clone it to", as possible. This means making sure that if I try to run code that's not ...
2
votes
1answer
170 views

Why does the local::lib shell code use eval and $()

using local::lib requires you to add a line to your ~/.shellrc eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib) I don't understand what the point of using eval, and encasing the statement in $() ...
13
votes
4answers
742 views

keep duplicates out of $PATH on source

I have the following code that's source-d by my .shellrc PATH="${PATH}:${HOME}/perl5/bin" PATH="${PATH}:${HOME}/.bin" export PATH but if I make changes to other code and then source this file, my ...
34
votes
2answers
2k views

$VAR vs ${VAR} and to quote or not to quote

I can write VAR=$VAR1 VAR=${VAR1} VAR="$VAR1" VAR="${VAR1}" the end result to me all seems about the same. Why should I write one or the other? are any of these not portable/POSIX?