Skip to main content
added 15 characters in body
Source Link
Ole Tange
  • 37.6k
  • 34
  • 120
  • 230

@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.6k
  • 34
  • 120
  • 230

@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.