Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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 ...
Vlastimil Burián's user avatar
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 ...
Petr Skocik's user avatar
  • 29.4k
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 ...
lese's user avatar
  • 2,736
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. ...
toxalot's user avatar
  • 1,025
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, ...
equaeghe's user avatar
  • 644
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?
user avatar
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 ...
gabe.'s user avatar
  • 12k