-   Linux - Software (
-   -   awk: fatal:cannot open file for reading (no such file or Directory) in Linux (

sangati vishwanath 07-05-2005 06:27 AM

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:


"|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( of a network printer.

The error what am observing is

awk: cmd. line:2: fatal: cannot open file `' for reading (No such file or directory)
Press ENTER to continue

acid_kewpie 07-05-2005 08:31 AM

right.. so that file doesn't exist... not sure what else we're meant to be telling you...

sangati vishwanath 07-05-2005 08:53 AM

Am trying to talk to a network printer with the mentioned IP address, which is not able to connect i suppose, any clues ?

acid_kewpie 07-05-2005 06:07 PM

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.

sangati vishwanath 07-06-2005 01:59 AM

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;


"|awk nc ${} 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.


All times are GMT -5. The time now is 10:11 PM.