Questions tagged [portability]
The portability tag has no usage guidance.
17
questions with no upvoted or accepted answers
5
votes
2answers
2k views
Is the use of sed's “a” command to prefix a line portable?
I noticed the following interesting behavior:
$ printf '%s\n' line{1..2} | sed $'1a\\\nPREFIX'
line1
PREFIXline2
$
Interestingly, this behavior is only possible for the last command in a Sed script,...
4
votes
0answers
348 views
Convert an existing customised Debian 10 Installation to Live ISO
Can someone help please?
I already did some research and found:
Linux Respin completely messed up my system when trying to install dependencies (removed a lot of packages I needed) - at least I am ...
3
votes
0answers
146 views
Portable way of finding files whose birth date is after a given timestamp
According to How to find creation date of file?, in Linux filesystems, such as ext4, Btrfs and JFS, that store the file creation time (aka birth time), it is possible to display the file birth time (...
1
vote
0answers
63 views
Why do BSD and GNU grep give different results here?
I distribute a slightly modified version of a public CSV file. To generate the modified CSV file I use a short one-line grep command:
grep -Ev '^([A-Za-zA-Za-z]|[0-90-9]*),' input.csv
Actual project ...
1
vote
0answers
29 views
making sqlcmd self-contained so it would be possible to run without installation, for CentOs
I am trying to make a bash script to connect to remote SQL server with sqlcmd
in the devp machine, as I have admin privileges, runs smoothly
but I NEED (and capitals because it is imperative) to build ...
1
vote
0answers
135 views
Portable way to set custom URL scheme handler for all users
I already know how to create a custom URL scheme and set its handler using xdg-utils:
xdg-settings set default-url-scheme-handler name handler.desktop
However, the command affects only the current ...
1
vote
2answers
1k views
select(2) on FIFO on macOS
On Linux the included program returns from select and exits:
$ gcc -Wall -Wextra select_test.c -o select_test
$ ./select_test
reading from read end
closing write end
first read returned 0
second read ...
1
vote
0answers
107 views
Any *nix variant withOUT `/bin/cat`?
I'm writing a simple regression test for a tool like which(1) and someone pointed out there's no guarantee that there is always /bin/sh (AIX seems to have sh(1) as /usr/bin/sh, for example) and we ...
1
vote
0answers
1k views
How to run .phar file with PHP CLI from an unpacked RPM?
How to reproduce:
"Install" PHP 5.4 (plus ncurses and OpenSSL libraries) from CentOS 7 repositories using rpm2cpio | cpio in a directory called "rpm"
Download phpunit.phar version 4.8.26
Run ...
0
votes
1answer
44 views
Are octal escape sequences more portable than hex ones for shell scripts
As part of a scheme for writing shell code that's capable of processing arbitrary data, I was looking for a way to convert null bytes to some other character. I found that tr requires arbitrary bytes ...
0
votes
0answers
33 views
Testing if a file descriptor is valid in really old shells
This is a follow-up question for "Testing if a file descriptor is valid." I am looking for a way to test whether file descriptors are valid that works, including with fds 0, 1, and 2, on ...
0
votes
1answer
77 views
How to make a shell script as portable as possible (POSIX and non-POSIX)
Situation: Writing a shell script to do some stuff across multiple shells
Problem: While Bourne-compatible shell scripts (bash, ksh, ash, zsh, etc) are easy to be made portable (just make sure the ...
0
votes
0answers
262 views
How to test a binary, to see if all shared library dependencies, are satisfied?
I have a program which I compiled on an earlier version of Fedora which suddenly broke after an upgrade. I was running an older version of Fedora at the time which had stopped receiving updates; so I ...
0
votes
1answer
492 views
MX Linux Not giving me the USB option while trying to install on it
I have make bootable USB of MX Linux with the help of RUFUS software. Now when I am trying to install on USB it does not show me partition to install it while I am booting live setup . The choose the ...
0
votes
0answers
58 views
Portably determine listen ports in shell script
I have an init script for an application, and know the PID is available from the script. I am trying to add some logic to the status command to output the TCP listen ports associated with the PID. I ...
0
votes
1answer
334 views
Equivalent in Mono on Linux of GetUpdateRect on Windows?
I'm trying to compile in Mono on Lubuntu 16.04.1 a very helpful open-source Windows program, "Ketarin".
It uses a function, "GetUpdateRect", which it finds in user32.dll, using this code:
[...
0
votes
1answer
719 views
Trying to write a portable Makefile
I'm working on my own netfilter module for the first time. According to internet documentation, The simplest module contains the following C code:
//'Hello World' kernel module, logs call to ...