LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-15-2012, 12:25 PM   #1
lxmirmsh
LQ Newbie
 
Registered: Nov 2012
Location: India
Posts: 23

Rep: Reputation: Disabled
kindly help me solve this error!thanks much!


x=$#
while [ $x-ne 0]
do
eval echo \$$x
x=`expr $x- `
done

error:
line 2: [:-ne: unary operator expected
 
Old 11-15-2012, 12:27 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Code:
while [ $x-ne 0 ]
(space after 0 and before ])
 
1 members found this post helpful.
Old 11-15-2012, 01:00 PM   #3
spazticclown
Member
 
Registered: Sep 2010
Distribution: Fedora, Android, CentOS
Posts: 91
Blog Entries: 2

Rep: Reputation: 21
You will probably need to add spaces between x and -ne as well as the before mentioned spaces by the brackets.
Code:
while [ $x -ne 0 ]
Hope this helps.
 
1 members found this post helpful.
Old 11-15-2012, 02:26 PM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by spazticclown View Post
Code:
while [ $x -ne 0 ]
Hope this helps.
Good Eye.
 
Old 11-16-2012, 12:46 AM   #5
lxmirmsh
LQ Newbie
 
Registered: Nov 2012
Location: India
Posts: 23

Original Poster
Rep: Reputation: Disabled
while [ $x -ne 0 ]

Thank you for your replies!
But its still no good!:/
it still gives the same error!
 
Old 11-16-2012, 09:42 AM   #6
lxmirmsh
LQ Newbie
 
Registered: Nov 2012
Location: India
Posts: 23

Original Poster
Rep: Reputation: Disabled
i got the output! thank you for your time!line 2: while [ $x -ne 0 ]
and line5: x=`expr $x - 1`
 
  


Reply



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
Error about loop device... Kindly help.. ashishshukla Linux - Server 1 05-30-2009 05:16 PM
How can i solve this error? bala_adi Red Hat 5 04-25-2009 09:26 AM
help me how to solve this error?? MahARaJaAngKaSa Ubuntu 1 04-20-2009 03:23 AM
Downloaded Wireshark source code and while make rpm got this error, kindly help pkhera_2001 Linux - Newbie 1 03-20-2008 08:09 AM
How to restrict CPU usage (kindly solve this) nedian123 Linux - Software 1 08-03-2004 01:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:57 AM.

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