Skip to main content
added 15 characters in body
Source Link
Ole Tange
  • 37.5k
  • 34
  • 119
  • 226

@cas shows how to use the shell. Personally I like to do it using a {= perl =} replacement string:

parallel echo '{= $_=2**$_ =}' ::: {5..10}

but the difference is tiny and more just a matter of taste.

There are situations, where the Perl version is better: If you for some reason is forced to use sha shell which does not have the $(( expression )) construct (e.g. fish) or need more computational functionality: parallel echo '{= $_=2**($_/2) =}'

@cas shows how to use the shell. Personally I like to do it using a {= perl =} replacement string:

parallel echo '{= $_=2**$_ =}' ::: {5..10}

but the difference is tiny and more just a matter of taste.

There are situations, where the Perl version is better: If you for some reason is forced to use sh which does not have the $(( expression )) construct.

@cas shows how to use the shell. Personally I like to do it using a {= perl =} replacement string:

parallel echo '{= $_=2**$_ =}' ::: {5..10}

but the difference is tiny and more just a matter of taste.

There are situations, where the Perl version is better: If you for some reason is forced to use a shell which does not have the $(( expression )) construct (e.g. fish) or need more computational functionality: parallel echo '{= $_=2**($_/2) =}'

Source Link
Ole Tange
  • 37.5k
  • 34
  • 119
  • 226

@cas shows how to use the shell. Personally I like to do it using a {= perl =} replacement string:

parallel echo '{= $_=2**$_ =}' ::: {5..10}

but the difference is tiny and more just a matter of taste.

There are situations, where the Perl version is better: If you for some reason is forced to use sh which does not have the $(( expression )) construct.