Originally published December 19, 2018 @ 5:41 pm
Admittedly, this has a limited range of practical applications and is more of a scripting exercise. The command shown here generates a bunch of temporary scripts each containing the sleep
command for up to one minute.
The scripts are ran in the background and upon exit will delete themselves. The number of processes will be limited to one-tenth on the maximum number of processes allowed by the kernel on your server.
(( x = $(grep -m1 [0-9] /proc/sys/kernel/pid_max) / 10 )) for i in $(seq 1 ${x}); do f=$(mktemp) chmod 700 ${f} cat << EOF > ${f} #!/bin/bash sleep $(expr $RANDOM % 61) rm -- "\(( x = $(grep -m1 [0-9] /proc/sys/kernel/pid_max) / 10 )) for i in $(seq 1 ${x}); do f=$(mktemp) chmod 700 ${f} cat << EOF > ${f} #!/bin/bash sleep $(expr $RANDOM % 61) rm -- "\$0" EOF ( ${f} & ); done" EOF ( ${f} & ); done
Experienced Unix/Linux System Administrator with 20-year background in Systems Analysis, Problem Resolution and Engineering Application Support in a large distributed Unix and Windows server environment. Strong problem determination skills. Good knowledge of networking, remote diagnostic techniques, firewalls and network security. Extensive experience with engineering application and database servers, high-availability systems, high-performance computing clusters, and process automation.