Last active
June 28, 2017 07:58
-
-
Save kastoestoramadus/58b6e448d7799f978b47 to your computer and use it in GitHub Desktop.
batch sendmail scala and bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys.process._ | |
import java.time.LocalDateTime | |
object SendMailMain { | |
def main(args: Array[String]) { | |
val start = LocalDateTime.now() | |
(1 to 1000).par.foreach { i => | |
print(s"$i ") | |
val out = s"echo anything $i" #| s"sendmail 123456789@[192.168.2.118]" !; | |
if(out!=0) print(s"\n$i") | |
} | |
println("\nseconds:" + LocalDateTime.now().minusNanos(start.getNano).getNano/1000) | |
} | |
} | |
---------------------------- | |
#!/bin/bash | |
date | |
COUNTER=100 | |
until [ $COUNTER -lt 1 ]; do | |
it=200 | |
until [ $it -lt 1 ]; do | |
echo "YOU ARE CURRENTLY IN YOUR HOME ZONE. YOU ARE CURRENTLY IN YOUR HOME ZONE." | sendmail 123456789@[192.168.2.118] & | |
let it-=1 | |
done | |
sleep 1 | |
let COUNTER-=1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment