Send character in sh script
I need to send the character $ and C in a script. One the same line just the two characters separated. I have read some script how-to's but no finding what I need.
|
What do you mean by send?
Do you mean echo? echo '$C' |
Sorry, Need to send the characters. $ C
I am logged on to a scale through telnet. The script logs me in. Now to retrieve the weight on the scale it requires the $ and the C. Echo displayed the character on the screen. Is there a send command to send the characters ? |
Quote:
|
Thanks for the reply. Didn't work... Is there a way to send an input file ?
|
Actually, once you've logged in with telnet, anything you type will be 'sent' to the remote system, so
telnet box1 username passwd # now you are logged in can type your chars $ C # or on same line $ C # or together $C we really need a a screenshot/more info to understand your issue. To copy to remote system use scp (or rcp if scp not avail) |
Can you provide some more information on the scale i.e. make / model and its communication protocol? Maybe a link too.
|
Will work on getting the make and model of the scale. This is the script that I am working on.
#!/bin/sh # Get weight off the scale! telnet <<EOF > pound.lis open 192.168.X.XXX # local address $C # command to populate pound.lis with weight on scale. Doesn't get sent ! exit EOF cat pound.lis This script will log me in to the scale. There is no username or password, unfortunately it will not retrieve the weight. pound.lis only shows successfully connected and the break charactors. If I send 192.168.X.XXX | tee pound.lis and then manually type $C the weight is sent to the pound.lis file. I would love to have this in a script. Can anyone help ? |
Quote:
Code:
If word is unquoted, all lines of the here-document are Code:
In the latter case, the character sequence \<newline> is |
All times are GMT -5. The time now is 08:43 PM. |