Is the shell’s `source` POSIX-standard?
It’s there under “dot”. NAME dot – execute commands in the current environment SYNOPSIS . file [etc.]
It’s there under “dot”. NAME dot – execute commands in the current environment SYNOPSIS . file [etc.]
Ksh93 (or bash) doesn’t have such expressions, so it’s better to make it explicit. But you can bundle multiple variables (with their initial values) in a single export phrase: export A=1 B=2 C=3 Testing: $ (export A=1 B=2 C=3 && ksh -c ‘echo A=$A B=$B C=$C D=$D’) A=1 B=2 C=3 D= Awkward alternatives There is … Read more
$ cat stack.sh #!/bin/sh if [[ $1 = “-o” ]]; then echo “Option -o turned on” else echo “You did not use option -o” fi $ bash stack.sh -o Option -o turned on $ bash stack.sh You did not use option -o FYI: $1 = First positional parameter $2 = Second positional parameter .. = … Read more
You can use easily: .find({ “_id” : CSUUID(“E3E45566-AFE4-A564-7876-AEFF6745FF”)})
You may need to escape the % with a \. % is a special character to the crontab, which gets translated to a newline, so your code was probably becoming -p’]T zw51′ Try: -p’]T\%zw51′
Sending a newline \n will exectue the command. .end() will exit the shell. I modified the example to work with bash as I’m on osx. var terminal = require(‘child_process’).spawn(‘bash’); terminal.stdout.on(‘data’, function (data) { console.log(‘stdout: ‘ + data); }); terminal.on(‘exit’, function (code) { console.log(‘child process exited with code ‘ + code); }); setTimeout(function() { console.log(‘Sending stdin … Read more
From “help test”: -z STRING True if string is empty.
In GNU coreutils, there’s tac(1)
You can use the Maven Dependency Plugin goal get together with LATEST as version for your artifact: mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:get -DremoteRepositories=<URL_to_your_maven_repo> -Dartifact=<group_id>:<artifact_id>:LATEST -Dpackaging=jar -Ddest=<target_dir>/<artifact_name>.jar
POSIX does not seem to specify mktemp(1). It looks like most modern systems have it, but the available functionality and the semantics of the options vary between implementations (so particular invocations may not be portable): mktemp(1) from OpenBSD — mktemp(1) originated in OpenBSD 2.1 mktemp(1) from FreeBSD mktemp(1) from Mac OS X — almost always … Read more