Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

portability

Is there a portable way to get the current username in Python?

August 21, 2022 by Magenaut

What is a portable way (e.g. for Linux and Windows) to get the current user’s username? Something similar to os.getuid() would be nice:

Categories Python, Q&A Tags portability, python Leave a comment

Which shells support ANSI-C quoting? e.g. $’string’

August 10, 2022 by Magenaut

I have a shell script that uses the following to print a green checkmark in its output:

Categories Q&A, Unix & Linux Tags escape-characters, portability, quoting, shell Leave a comment

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

August 10, 2022 by Magenaut

I see I can do

Categories Q&A, Unix & Linux Tags portability, posix, shell, test Leave a comment

Testing if a variable is empty in a shell script

August 10, 2022 by Magenaut

I have seen the following technique used many times on many different shells, to test if a variable is empty:

Categories Q&A, Unix & Linux Tags portability, shell, shell-script, test Leave a comment

What is the most portable method of launching a terminal emulator?

August 10, 2022 by Magenaut

Say I need to write a script that will launch a terminal and execute a command and I need that to work on various systems. How can I do that in a safe and portable manner?

Categories Q&A, Unix & Linux Tags portability, terminal-emulator Leave a comment

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

August 10, 2022 by Magenaut

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 the following:

Categories Q&A, Unix & Linux Tags portability, posix Leave a comment

How can I safely get the version of ksh?

August 10, 2022 by Magenaut

How can I safely get the version of ksh from within a ksh script?

Categories Q&A, Unix & Linux Tags ksh, portability, shell-script, version Leave a comment

Is “/etc/issue” common for all Linux distributions?

August 8, 2022 by Magenaut

I’m trying to Create OS detect portable function in bash script,

Categories Q&A, Unix & Linux Tags etc, login, portability Leave a comment

Unix-portable way to get script’s absolute path in zsh?

August 7, 2022 by Magenaut

What is a portable1 way for a (zsh) script to determine its absolute path?

Categories Q&A, Unix & Linux Tags filenames, portability, shell-script, symlink, zsh Leave a comment

tail -f, but with line numbers

August 7, 2022 by Magenaut

I’m trying to see how many times foo bar appears in /var/log/foo.log within an arbitrary amount of time on a remote server, but nothing that I’ve tried so far has worked.

Categories Q&A, Unix & Linux Tags logs, portability, text-processing, ubuntu Leave a comment
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress