Svdrpsend.sh
Aus VDR Wiki
(Unterschied zwischen Versionen)
K |
K |
||
Zeile 3: | Zeile 3: | ||
<pre> | <pre> | ||
#!/bin/sh | #!/bin/sh | ||
− | |||
− | |||
while [ $# != 0 ] ; do | while [ $# != 0 ] ; do | ||
Zeile 30: | Zeile 28: | ||
exec 5<>/dev/tcp/${HOST:-localhost}/${PORT:-2001} || exit | exec 5<>/dev/tcp/${HOST:-localhost}/${PORT:-2001} || exit | ||
echo "$ARGS" >&5 | echo "$ARGS" >&5 | ||
− | + | while read -t 1 i ; do | |
+ | echo "$i" | ||
+ | done <&5 | ||
+ | exec 5>&- | ||
</pre> | </pre> | ||
[[Kategorie:svdrp-anwendungen]] | [[Kategorie:svdrp-anwendungen]] |
Aktuelle Version vom 19. April 2008, 22:25 Uhr
Erster Versuch, ohne perl.
#!/bin/sh while [ $# != 0 ] ; do case $1 in -d) HOST=$2 shift 2 ;; -p) PORT=$2 shift 2 ;; *) ARGS=$ARGS" $1" shift ;; esac done if [ "${#ARGS}" = 0 ] ; then echo "Usage: $0 options command..." echo "Options: -d hostname destination hostname (default: localhost)" echo " -p port SVDRP port number (default: 2001)" exit fi # Your BASH have to be compiled with /dev/tcp/ support! exec 5<>/dev/tcp/${HOST:-localhost}/${PORT:-2001} || exit echo "$ARGS" >&5 while read -t 1 i ; do echo "$i" done <&5 exec 5>&-