time seq 100 | xargs -i bash -c 'echo {}'
; 2.530s
time seq 100 | xargs -i sh -c 'echo {}'
; 0.223s
why?
PS: The title of mine for this post is more intuitive to be discovered or searched by google or any sort of search engines.
time seq 100 | xargs -i bash -c 'echo {}'
; 2.530s
time seq 100 | xargs -i sh -c 'echo {}'
; 0.223s
why?
PS: The title of mine for this post is more intuitive to be discovered or searched by google or any sort of search engines.
@terdon in this post answered the related question of mine, but I missed one more question in that post.
Plz refer to the following commands:
calc(){ awk "BEGIN{ print $* }" ;}; calc "((3+(2^3)) * 34^2 / 9)-75.89"
The above commands work fine with calculated result '1337'.
echo '((3+(2^3)) * 34^2 / 9)-75.89' | awk "BEGIN{ print $* }"
But the above commands don't give any result while @terdon explained well about why.
Could you advise what made the first example work with $*?
$ script-in-script.sh > /dev/shm/output.txt; works fine.
But, if you put the above command line in script.sh
and add
* * * * * script.sh
in crontab -e it doesn't work. /dev/shm/output.txt is created anyway but empty.
How can I make it work in crontab -e
?
PS: script-in-script.sh
and script.sh
both are executable.
:script-in-script.sh
#!/bin/bash
echo "This Text";
:script.sh
#!/bin/bash
script-in-script.sh > /dev/shm/output.txt;