posted
So inorder to check to see if $x already exists in /Pract.file
I'm trying to do awk '/$x/' Pract and if it works should display all lines that are in the variable "x" which is echo x="`echo $y | cut -d' ' -f2 | cut -c1-3``echo $y | cut -c1-3`"
IT ran, there's no syntax error but its not displaying anything, in theory I want it to display lines of text allowing me to do a conditional statement in regarding if the name already exists. Whats wrong?
posted
Without offering to do your hw for you, here's a little pointer: Single quotes don't allow variable substitution in the bash shell. So, your '/$x/' is trying to match on the end of line, *followed* by x on the same line, which of course is impossible.
Beyond that, it's not clear to me what you're trying to do...
Posts: 120 | Registered: Jun 2005
| IP: Logged |