Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-05-2005, 05:27 AM
|
#1
|
LQ Newbie
Registered: Jul 2005
Posts: 4
Rep:
|
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
|
|
|
07-05-2005, 07:31 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
right.. so that file doesn't exist... not sure what else we're meant to be telling you...
|
|
|
07-05-2005, 07:53 AM
|
#3
|
LQ Newbie
Registered: Jul 2005
Posts: 4
Original Poster
Rep:
|
Hi,
Am trying to talk to a network printer with the mentioned IP address, which is not able to connect i suppose, any clues ?
|
|
|
07-05-2005, 05:07 PM
|
#4
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
07-06-2005, 12:59 AM
|
#5
|
LQ Newbie
Registered: Jul 2005
Posts: 4
Original Poster
Rep:
|
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 12:57 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|