1.

Solve : Another Linux problem. Please help me.?

Answer»

The problem is that follows:
Construct a program (Shell script), called VERIF that asks for a name and verifies if it APPEARS in other file called LISTING

I DONT know how begin with this problem....

HARLEQUIN.man grep

man awk

Remember that all programs return an exit code which indicates their success or failure.

Good luck.Ok. Thanks for this clue. I will TRY doing something in that sense...

And I will tell you...

HARLEQUINActually, I should have said

info gawk

since the Texinfo page is much better than the man page, and the utility's proper name on Linux systems is usually "gawk" (GNU awk).I just done it!!

the code is like follows:

[emailprotected]> //(this is the prompt)
[emailprotected]> cat > LISTING
James
Edward
Jhon
Peter
Paul
[emailprotected]> //(and the file that contains the names is ready)

Now comes the shell script:

echo -n "Write a name: "
read name
if (grep -C $name LISTING) then
echo "This name exists in LISTING file."
else
echo "This name doesn´t exist in LISTING file."
fi

And this runs so fine....
Thanks very much Robpomeroy.... You have saved my life...
HARLEQUINWell done!



Discussion

No Comment Found