All Questions
Tagged with portability scripting
7 questions
2
votes
1
answer
2k
views
POSIX and Portability | shell scripts | grep -s, grep -q
I am all in for portability in regards to shell scripts.
But I am unsure if I am overdoing it right now.
In this example, we have a function called confirmation, which accepts the very first ...
2
votes
1
answer
524
views
Multiple arguments in shebang lines
Linux only supports one argument in a shebang line:
This:
#!/bin/sh
cat > pr_args <<'EOF'
#!/bin/sh -e
printf "'%s'\n" "$@"
EOF
cat > shebang <<'EOF'
#!pr_args a b c
EOF
chmod +x ...
4
votes
1
answer
19k
views
How / Is it possible to install python in a portable way?
I'm working on a python script which takes care to migrate a mysql database with a certain schema / structure, into a postgresql database with a different structure.
During the development phase I ...
19
votes
2
answers
2k
views
When is it important to write portable scripts?
Most code I write is in PHP. I have recently started learning shell scripting. Most of the resources and tutorials that I've come across are specific to Bash. Some warn about bashisms and some don't. ...
8
votes
3
answers
7k
views
How to share a GNU sed script between Linux and Mac OS X
I have a GNU sed script I use on Linux; it is installed at /bin/sed and it seems it contains GNUisms. I have collaborators using Mac OS X. They have installed (non-GNU) sed, located at /usr/bin/sed, ...
23
votes
8
answers
10k
views
The most universal scripting language for Linux is?
We are writing scripts for Linux systems, there has been some debate over what would be the most universally Linux present scripting language to use. Bash, SH, Posix? What?
6
votes
3
answers
16k
views
How can I test if a program is running from within a script
Let's assume that another user started a bunzip process, and I have a script that I'd like to start running after that bunzip finishes. What's the best way to check from inside my script that the ...