awk: fatal:cannot open file for reading (no such file or Directory) in Linux
When i tried to run some scripts over Linux, the script used to fail because of this line in scripts:
HOST: $IP "|awk nc ${IP} 80|awk '/HTTP/ {printf "[1m%s[0m\n",$0}; !/HTTP/ {printf "%s\n",$0}' read L?"Press ENTER to continue" echo "\n${UND}PUT${NOR}" echo "PUT /etc/hosts HTTP/1.1 Where IP is IP address(10.255.114.207) of a network printer. The error what am observing is awk: cmd. line:2: fatal: cannot open file `10.255.114.207' for reading (No such file or directory) Press ENTER to continue |
right.. so that file doesn't exist... not sure what else we're meant to be telling you...
|
Hi,
Am trying to talk to a network printer with the mentioned IP address, which is not able to connect i suppose, any clues ? |
well it's just wrong... that awk command is expecting a file input, a file with the name of the IP address...
This is one line from a script which is i don't know how big... you've given no context as to how the IP is being interpreted... maybe there is meant to be a file of that name, maybe there isn't.. we've no idea. |
Hi Chris,
How i run the script is , i pass the IP address of printer as an argument to the script; When i try to execute the script pertaining to the Printer, HOST: will reflect the IP address of printer what i have passed; HOST: 10.255.114.207 "|awk nc ${10.255.114.207} 80|awk '/HTTP/ {printf "[1m%s[0m\n",$0}; !/HTTP/ {printf "%s\n",$0}'; Will this information be sufficient ? If not will post the complet flow of script which uses awk in a Perl script. Thxs Vishwa |
All times are GMT -5. The time now is 06:54 PM. |