Hi guys I am trying to interface with an old industrial scanner through an old PC with an old network card and a copy of Linux.
It now needs to speak to a Windows XP machine, but I have no idea what the Windows equivalent of these functions would are:
Any help anyone can do to help me translate these actions would be very much appreciated.
Big thanks
Tony
Last edited by Scott; 01-16-2011 at 11:43 AM..
Reason: Code tags
I can't speak about whatever's in the rest of your script, but all four of those lines should run properly in windows CMD and/or a batch file as long as you have an nc.exe available in the current directory or somewhere in your PATH (and your network settings allow you to talk to that odd address!)
I think that "nc" must be netcat. It's a pretty common tool that just connects a TCP socket on the given port and address, writes what it's told to write, and prints whatever it gets back to terminal. (or file, when redirected like >filename). This script appears to be connecting to the device on port 80(the standard HTTP port), sending two-character commands, and sometimes saving the result it gets back from it into a txt file.
Netcat has windows ports available in many places.
Also, another section of the code uses the function stripcat e.g.
./stripcat union.txt
anyone know of this function? My preliminary search on google has proved unsuccessful.
Here's a basic intro to shell scripting, then. "echo", even in windows CMD, just prints what you tell it to.
The netcat command reads from the terminal, that is, sends what you type into it.
Or, it can read from another program, which is what | is for. echo !1 | nc 255.255.2.2 80 prints !1 and netcat reads it, sends it over the network socket, and prints what it gets back to the terminal.
So yes, the echo is necessary, it's two commands used in concert. If you didn't feed something into it, netcat would just sit there waiting for you to type...
Quote:
Also, another section of the code uses the function stripcat e.g.
./stripcat union.txt
anyone know of this function? My preliminary search on google has proved unsuccessful.
It's being run from the current directory, which suggests it's a custom program made for this application. Hopefully another shell script. Its name suggests it's a filter of some sort but what it actually does I can't guess, if you could post its contents that'd help a lot.
Last edited by Corona688; 01-16-2011 at 07:05 PM..
Hi Guys,
I have a file which contains multiple lines. I need to split each line 255 characters and then I need to add call statement in the front and semi colon at the end.
I/P:
call sp_rebuildindex('aaa.aaa','column column column column column column column column column column ... (4 Replies)
I'm trying to connect from Server A to Server B to transfer files from A to B. I'm using NUID A1 in Server A and NUID A2 in Server B. I have done the following the steps to setup password-less login.
1. Add the public key of A1 in A to the Authorized keys of A2 in B.
2. Add the public key of... (4 Replies)
Hello,
I am using sed command to place a comma dynamically in certain positions. When the position variable exceeds 255 characters, it errors out. I would appreciate if someone can point in the correct direction
sed 's/^\(.\{'"$pos"'\}\)./\1,/' ragha.txt > ragha3.txt
If $pos > 255,... (8 Replies)
Gurus,
sed -e "s/\(.\{1,255\}\)\(.\{1,2\}\)\(.*\)/\1AB\3/" FILE ---this works
sed -e "s/\(.\{1,468\}\)\(.\{1,2\}\)\(.*\)/\1AB\3/" FILE ---this does not
It works only till 1,255 ( any number below 255 works)
Any one know how to increase this limit.
Thanks
Sirababu (4 Replies)
HI guys
When i try SFTP to a machine using a user account whose entry in
/etc/passwd as follows
user:x:8005:508::/export/home/user:/bin/false
and i am not placed my keys over there i am using the password option in the sftp
Since the keys are not there it ask for the password
... (5 Replies)
I have searched google and these forums as well. I am trying to compile proftpd on a vanilla Solaris 10 server and I am getting an error when I try to 'make'
Server - Solaris 10 update 4
Installed packages from sunfreeware.com
autoconf-2.60-sol10-sparc-local... (2 Replies)