Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

telnet communication via bash

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
akraix
Posts: 2
Joined: 2006-11-20 12:26

telnet communication via bash

#1 Post by akraix »

hi,

i am searching for a solution to the following problem:

i want a bash script to automatically communicat with the telnet server. i want it to scan several folders for files and if there are any to request them.

Code: Select all

find $folder -maxdepth 1 \( -iname '*.mp3' -o -name '*.ogg' \) -exec echo "scheduler.push {} | telnet localhost 1234" \; 
the problem is: the find returns something like "missing argument for -exec". i am wondering what i am doing wrong, as the telnet part works very well once put into a script without the find:

Code: Select all

#!/bin/bash 
 (echo "telnet command" 
  echo "another telnet command" 
  echo "yet another telnet command") \ 
 | telnet localhost 1234
what the heck am i doing wrong?

thanks for your support,

akraix

Post Reply