LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 01: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, 01:27 PM   #2
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,190
Blog Entries: 10

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Code:
while [ $x-ne 0 ]
(space after 0 and before ])
 
1 members found this post helpful.
Old 11-15-2012, 02: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, 03:26 PM   #4
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,190
Blog Entries: 10

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by spazticclown View Post
Code:
while [ $x -ne 0 ]
Hope this helps.
Good Eye.
 
Old 11-16-2012, 01: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, 10: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


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


All times are GMT -5. The time now is 05:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration