Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-26-2014, 12:49 PM   #1
LQ Newbie
Registered: Feb 2014
Posts: 2

Rep: Reputation: Disabled
variable substitution results in "command not found" error

find /data/backup/ -name 20140202* -exec awk -F"|" '$23!=0 {print"|"$14"|"$23}' {} \; > Day1.txt

echo "$user"
echo "$passwd"
echo "cd /data/"

echo "find /data/backup/ -name rec20140202* -exec awk -F"|" '$23!=0 {print"|"$14"|"$23}' {} \; > Day2.txt"

echo "exit" )| telnet "$host"

in the above code fragment second find command ( inside telnet part)is not working. I am getting an error as below
server2:/data # line 27: '3!=0 {print: command not found line 27: 4: command not found line 27: 3: command not found line 27: }' {} \; > Day2.txt: command not found
Connection closed by foreign host.

Pls help
Old 02-26-2014, 02:15 PM   #2
Senior Member
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Look carefully at that line, check the double-quotes!
What you want is to wrap the whole line in double-quotes, but actually the first enclosed is "find /data/backup/ -name rec20140202* -exec awk -F"
1 members found this post helpful.
Old 02-27-2014, 11:55 AM   #3
LQ Newbie
Registered: Feb 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you very much pingu!

Use of escape (\) preceding character for (") and ($) has solved the issue.


- Sharath


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running command in gnome-terminal from script results in "...error creating child..." PlancksCnst Linux - General 6 04-08-2009 01:09 PM
LFS6.3 livecd "ls : command not found" error after "su - lfs" rotu Linux From Scratch 2 06-19-2008 04:59 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
"Successful install" results in "Boot device not found" slackr007 Fedora 2 06-21-2005 05:05 PM
"Successful install" results in "Boot device not found" slackr007 Linux - Newbie 2 05-31-2005 09:02 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:38 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration