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

30
votes
2answers
1k views

What is the point of the `cd` external command?

As referenced in this fine answer, POSIX systems have an external binary cd in addition to the shell builtin. On OS X 10.8 it's /usr/bin/cd. You can't use it like the builtin cd since it exits ...
3
votes
1answer
135 views

the return built-in

According to the Open Group, [t]he return utility shall cause the shell to stop executing the current function or dot script. If the shell is not currently executing a function or dot script, ...
6
votes
2answers
219 views

What is difference between [ and [[ in BASH? [duplicate]

Possible Duplicate: using single or double bracket - bash When should I use a single bracket? [ When should I use double brackets? [[ Are both POSIX compliant?
14
votes
2answers
2k views

How can I test for POSIX compliance for shell scripts?

Probably the main thing that this website has taught me so far is the importance of writing portable shell scripts. Considering that POSIX is the closest thing to a common standard between all ...
1
vote
1answer
114 views

Linking “..” do somewhere other than parent directory and other strange fs beharviors

Can the entry ".." become linked to someplace other than the parent directory? Is it possible to cause "tar" to create this weird behavior? Scenario: I have a pre-built compiler to a embeded system, ...
1
vote
1answer
878 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
998 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
550 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 ...
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 ...
14
votes
2answers
941 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
433 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 ...
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 ...
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 ...
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?
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 ...
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
689 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
743 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 ...