Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [posix]

The tag has no usage guidance.

1
vote
2answers
63 views

Is it POSIX-compliant to use a shell function in a pipeline?

Is it possible to use a shell function in a pipeline? Say I had a function that acted like grep, called mygrep. Is there any way, using only POSIX shell features, to be able to invoke mygrep like ...
0
votes
1answer
29 views

POSIX equivalent of OpenBSD's find -false

GNU find, FreeBSD find and NetBSD find all have option -false, but OpenBSD find does not. Granted, POSIX does not require an option -false for find, but still, this is very annoying. How can I ...
3
votes
1answer
147 views

Why it is not recommend to set default shell for root uset to a non-POSIX shell?

I am going to change my root’s default shell from bash to fish. As far as I know, fish is a not a POSIX standard shell. On the other hand, maybe kernel or other things in the system have a relation ...
9
votes
3answers
917 views

does PATH search include symlinks?

The POSIX shell standard says on this site http://pubs.opengroup.org/onlinepubs/9699919799/ about how shells use PATH to look for executables: "The list shall be searched from beginning to end, ...
0
votes
0answers
24 views

POSIX compliant way of saving content of regex capture groups in variables

I am building a sh script that needs to be as much POSIX compliant as possible and I want to extract data from system files, I wrote regular expressions to do this but I can't find how to put the ...
0
votes
1answer
154 views

APFS broke find command

I just upgraded to APFS on an external drive. Now this is happening: find /Volumes/FDDISK | head /Volumes/FDDISK /Volumes/FDDISK/.HFS+ Private Directory Data /dir_2354142ISK/.HFS+ Private Directory ...
1
vote
1answer
436 views

Is it possible to catch the command not found error?

So, if you're on Posix, and you type something that isn't a command, it gives you a "command not found" error. > ggg -bash: ggg: command not found Is there a way to intercept this and have it ...
0
votes
1answer
83 views

Can a file divide anything smaller then 8bits?

Short Question: What is the smallest unit savable to a file? What is the smallest divisible unit of a file? Long Question: I've been looking through the internet, trying to find out if I can access ...
0
votes
0answers
73 views

Why is ac showing 0.00 on macOS under an admin account?

I'm on macOS 10.12, running an admin account, and when I run ac from zsh I get: ┌[me@My-MacBook-Pro] [/dev/ttys000] └[~]> ac total 0.00 Why? It's supposed to show user logged-on ...
1
vote
0answers
111 views

Trouble sending email via posix script

I have a smtp server to send emails through Red Hat 7.2 If I type the commands on the server the mail is send successfully. However, I have tried to create a script to send mails automatically but it ...
0
votes
1answer
588 views

How to know if a parent process is waiting for a child process in Linux

In Linux given two processes with known pIds, and one being the parent of the other, is it possible to know if the parent is waiting for the child process to finish? Thanks
1
vote
1answer
70 views

chtag does not work on zOS unix

I'm trying to tag ASCII files on zOS host shell, so we do not have to specify the code page on the command line. > echo > iso.txt > chtag -t -c 819 iso.txt > vi iso.txt Type in "Hello" ...
1
vote
1answer
66 views

Order of files matched by a glob

Suppose I have the following files in a folder 1.txt 2.txt a.txt b.txt c.txt If I match those files by a glob in order to process them, e.g. for f in *;do echo $f;done then Bash will match them - ...
0
votes
2answers
182 views

How can function definition be part of pipe sequence in POSIX shell grammar?

The POSIX shell grammar at http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10_02 says pipe_sequence : command | ...
0
votes
1answer
103 views

How can I set a modified PATH for a non-interactive non-login POSIX shell invoked by Scons on Cygwin?

Because I work on a number of separate projects, (each of which uses a different compiler), I don't like to have the path to any one compiler set in my PATH. Now I have joined another project where ...
1
vote
1answer
30 views

Are device IOs handled even when a device is not opened by any process?

The following shell program examples makes the question clearer. Given a simple character device (a ftdi ttyUSB device in my case), I send it a request with echo to open();write();close(); the device,...
1
vote
0answers
103 views

How can I delete every hourly backup except the 24 most recent ones?

I used to have a server with hourly/daily backups, all readily available thanks to this nice tutorial. Unfortunately, said server fried and I now have to make my backups on a NAS which doesn’t run1 my ...
0
votes
1answer
222 views

Unknown option -pthread in LD

This is a follow up from this issue on Github. Basically, on OS X El Capitan, I get this message: ld: unknown option: -pthread clang: error: linker command failed with exit code 1 (use -v to see ...
-1
votes
2answers
667 views

what does “exec 5>>foobar.txt” do?

What does the shell command exec 5>>foobar.txt do? I can't google it for obvious reasons, and otherwise not sure where to start looking.
0
votes
1answer
168 views

Passing unix shell (optional) text parameter without expansion

I want to write a unix/linux script updategit.sh with a default parameter to commit to git. updategit.sh should be POSIX compatible. I hope POSIX will solves some of worst incompatibilities of the ...
7
votes
1answer
4k views

How to convert a Windows path (with backslashes) to Unix format on Babun/Cygwin

I'm using Windows and writing shell scripts to run on Babun (a POSIX api). I need to read a path from an environment variable, $USERPROFILE, and convert it to unix style (replace \ by /, c:\ by /c/) ...
7
votes
2answers
5k views

SUID bit on directories

In Linux there are SUID, SGID, and sticky bits for directory permissions. I am absolutely clear about the sticky and SGID bit on files or folders. But what happens if I apply SUID bit on a directory?...
0
votes
0answers
73 views

What are the -DPOSIX and -DXWINDOWS flags for in Makefiles?

I see -DPOSIX has something to do with POSIX compliancy...which I can kinda get my head around because my program uses a posix library (pthreads) but I can't dig up anything relevant on what -...
0
votes
0answers
536 views

POSIX and ACL permissions Mac Server

I have a mac mini server and have a script run at login for network users that mounts a shared drive on the mac server. When they mount up, I create a folder with their name as the folder name. What ...
1
vote
1answer
804 views

Filezilla regex for filtering out all subdir except one

I'm trying to get filezilla filtering out all the subfolder of a certain folder except one without success. My tree looks like this: css/ |--many files and dirs... js/ |--many files and dirs... ...
3
votes
2answers
521 views

Execute script on ipv6 prefix change

How can I execute a script or program whenever my (world-routeable) IPv6 prefix changes? If there is (currently) no easy way to do this, a pointer to the corresponding Posix system calls would be ...
1
vote
0answers
26 views

set ACL for BackupUser

I want to backup a whole bunch of folders from different users remotely. Therefore I created a special user that is able to log into the machine and (should) have the right to read all the files via a ...
2
votes
1answer
4k views

How to get list of process ids that are in a given group id

Going by the man page, I would expect this to work: ps ah -o pid,pgrp -G 18322 But this shows exactly the same list as without the -G arguments. I want a saner way to produce this output: ps ah -o ...
0
votes
0answers
173 views

How to make sudo with POSIX shell better?

I have made changes to my Arch Linux x86-64 system where I run bash exclusively through what I think is POSIX mode, through using /bin/sh (linked to '/bin/bash') as my login shell and instead of ...
1
vote
1answer
769 views

Windows 7 Ultimate versus Cygwin: POSIX compliance and is it practical to install a GNU system directly on Win 7 Ultimate without Cygwin

What are the advantages or disadvantages of using GNU/Linux utilities on Windows 7 via Cygwin as opposed to making use of Windows 7 Ultimate SUA (Subsystem for UNIX-based applications) support (...
0
votes
2answers
352 views

What is the smallest POSIX OS? [closed]

What is the smallest POSIX operating system that has a live CD and can be installed? ⠀It must support wifi. ⠀I only need a CLI interface.
19
votes
2answers
18k views

What is the difference between /etc/environment and /etc/profile?

I understand that the former is loaded prior to the latter, but what is the conceptual difference? Are there any good reasons I should set some variables in one and not in other? Except the fact that /...
1
vote
0answers
108 views

What''s the “earliest” place one can set an environment variable during Linux boot process?

I know I can set a variable in a shell startup file, but the thing is, I am trying to set up a POSIX-compatible environment, and a POSIX shell does not parse any startup files other than the one ...
3
votes
2answers
886 views

Documentation on “BSD General Commands”

I cringe to ask this question, but for many commands on OS-X and probably other POSIX systems, it's difficult for me to find needed documentation on the built-in commands. For example, if I want to ...
15
votes
3answers
19k views

What's the difference between SIGKILL and SIGSTOP?

The manual describes SIGKILL and SIGSTOP like this: SIGKILL 9 Term Kill signal SIGTERM 15 Term Termination signal SIGSTOP 17,19,23 Term Stop the process ...
7
votes
2answers
57 views

discover the directory that prevents a file from being read in linux

i'm getting a permission denied for a user in a really long path. $ sudo sudo -u user cat /l/o/n/g/path/file Permission denied i'm pretty sure path and file have permissions for that user. Is there ...
2
votes
2answers
217 views

OpenOffice Calc regex returns wrong value - what's wrong with my regex?

I have a column of text with values concatenated by my bank, as in a typical monthly statement. Here is an example (column A240): OCT 26 BALANCEPROTECTOR PREMIUM $10.05 I'm trying to set the ...
2
votes
1answer
197 views

Stop wget but allow convert-links

I'm running a wget command with a rather deep recursion depth. The deep recursion depth is needed to get the files I want, but I don't want to wait for the operation to complete. I see that I can ...
14
votes
4answers
12k views

bash pipe construct to prepend something to the stdoutput of previous command

I want to use sendmail to send me stuff and want to do it in a oneliner. echo "mail content" | sendmail emailataddres.com Sends it without subject. The subject line must come before the Mail ...
28
votes
6answers
13k views

Alternative to the tee command without STDOUT

I'm using | sudo tee FILENAME to be able to write or append to a file for which superuser permissions are required quite often. Although I understand why it is helpful in some situation, that tee ...
2
votes
0answers
164 views

Quick method using POSIX tools to generate a random file

So I'm using a board on a ramfs that is pretty much running a barebones Linux kernel that is pretty much just POSIX-compliant (with busybox). For some disk drive testing, I am trying to generate a ...
3
votes
2answers
367 views

What is the point of UNIX's rmdir?

I'm new to UNIX (MAC OS X bourne shell POSIX), I understand rmdir will only remove an empty directory but under what circumstances would you actually want to use rmdir <directory name> and not ...
0
votes
1answer
193 views

Mutt and msmtp interoperability

I am working on configuring /mutt/ to send mail via /msmtp/. Strangely, if I user /msmtp/ from shell, all okay, that means, that .msmtprc is correct. However, mail sent with mutt do not come. I have ...
28
votes
2answers
15k views

How to delete a file with a weird name?

I wrote a program that uses POSIX memory-mapping function (mmap) The program takes a file (a.dat) and memory-maps it for reading/writing. Due to errors in the program, every time I run the program a ...
1
vote
0answers
518 views

Why are POSIX timezones relative to UTC opposite from most others (and what's intutively correct)? [closed]

In POSIX, UTC-2 means 2 hours after UTC, and UTC+2 means 2 hours before UTC. In other words, If it's currently 8am in UTC, it's 10am in time zone UTC-2, and 6am in time zone UTC+2. This thread ...
3
votes
2answers
2k views

Executable can't find correct files when called via symbolic link

I made a symbolic link to an executable with ln -s /usr/bin/mydir/myexec /usr/bin/myexec When I executed myexec in Bash, it does not load the proper files which are located in the original myexec's ...
2
votes
0answers
825 views

List of POSIX-certified operating systems?

Where can I find a list of POSIX-certified operating systems? The official list contains just six entries.
3
votes
2answers
1k views

Unicode-based POSIX tools (other than Cygwin) for Windows?

GNU Win32 and MSYS are awesome, but it seems like all of their tools use the ANSI version of the Windows API, rather than the Unicode versions. Obviously, those are meant for Windows 95 and 98, not ...
24
votes
3answers
9k views

Why is NTFS case sensitive?

I personally thought that NTFS was case insensitive, since you can type cmd, CMD, cMd or even CmD and still get the command prompt. However, why is it that during a CHKDSK x: /f /r, sometimes it fixes ...
1
vote
1answer
370 views

If SUS exists then why there's also POSIX? [closed]

We know that to define whether the system is Unix or not there's a Single UNIX Specification(SUS) which is held by OpenGroup. Then why there's another certification as POSIX? Are these things the same?...