Sponsored Content
Full Discussion: unary operator expected
Top Forums Shell Programming and Scripting unary operator expected Post 302295013 by Corona688 on Friday 6th of March 2009 10:16:55 AM
Old 03-06-2009
If $j has no value at all, the expression will be invalid because it will vanish entirely, making it look like just [ -j 50 ]. Wrap $j in double-quotes and it won't vanish, becoming [ "" -lt 50 ] , which still isn't altogether sensible -- comparing a blank string to an integer -- but at least has correct syntax.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

unary operator expected error

Hi I am doing a script like if then echo "table name dosent exist" exit fi the problem is if $table_name is null then i am getting the error Please help me Thanks in advance (2 Replies)
Discussion started by: ssuresh1999
2 Replies

2. UNIX for Dummies Questions & Answers

[: =: unary operator expected

HI, while running a script, I got the below mentioned error. /bin/sh: line10 : supportedMozillaVersion() { case "$*" in *rv:1.*) return 0;; *rv:.*) return 0;; *rv:*) return 1;; Mozilla\ 1.*) return 0;; Mozilla\ .*) return 0;; *) return 1;; esac } supportedFirefoxVersion() { case... (7 Replies)
Discussion started by: bhag281
7 Replies

3. Shell Programming and Scripting

unary operator expected

Im trying to fix my /etc/weekly that rotates various logs however it does them no matter what filesize they are and i want them to only do it if there file size exceeds 2M or something. So I'm playing with a script to get the filesize using a ls -l command which works and puts the value into a... (3 Replies)
Discussion started by: timgolding
3 Replies

4. Shell Programming and Scripting

line 5: [: -gt: unary operator expected

Hello all, :confused: I am not getting this error. Pls help me. ./construct_operon.sh: line 5: #!/bin/bash # Construct Operons using gene pairs. rm -rf operons_result lines=`awk 'END {print NR}' ecoli_operons` while ; do head -1 ecoli_operons | awk '{print $1"\n"$2}' > pattern ... (5 Replies)
Discussion started by: admax
5 Replies

5. UNIX for Dummies Questions & Answers

Error : -ne: unary operator expected

find . -name "*.*"|xargs grep WT:DBF_WL>> $F Wfexist=`cat $F|grep $i` echo $Wfexist if ; then echo $Wfexist echo "Workflow Exist" else touch $O chmod 777 $O echo $Wfexist echo $WfExist >> $O fi I am getting the error that -ne: unary operator expected in the line with red... (2 Replies)
Discussion started by: ritu.s
2 Replies

6. UNIX for Dummies Questions & Answers

Problem unary operator expected

I get the following error ./get_NE05: line 42: while do echo ${STRING_NAME} J=1 if ; then EXT=0$I else EXT=$I fi while do echo $I-$J #calculating last occurrence OCCURRENCE=`grep -io "${STRING_NAME}"... (3 Replies)
Discussion started by: f_o_555
3 Replies

7. Shell Programming and Scripting

unary operator expected

i=0 while Shell script reports an error "unary operator expected" pointing the above line. $i by default is 0 and holds integer value and $buf is also holding integer value. Please can some one let me know what is missing. Thanks. (1 Reply)
Discussion started by: sunrexstar
1 Replies

8. UNIX for Dummies Questions & Answers

: unary operator expected

Hiya all, Why do I get a :unary operator expected when I try to put a condition statement in my shell script (sh) like so and how to fix? if ; then echo "say hello" else echo "don't say hello" fi ? It seems if the script receives an argument it works but if I don't put an... (4 Replies)
Discussion started by: cyberfrog
4 Replies

9. UNIX for Dummies Questions & Answers

[: -gt: unary operator expected

Hi I have problem with my script. I dont now why but i don't change anything and script stop working. this is my code: #!/bin/sh for i in `ps -A | grep pocron.sh | grep -v grep | awk '{print $2}'` do COUNT=$((COUNT+1)) done ostatnie_wykonanie=`cat porader.log`... (1 Reply)
Discussion started by: fotex
1 Replies

10. Shell Programming and Scripting

Unary operator expected

In all my Googling, this usually happens when someone is comparing a variable, and that variable is unset. That doesn't appear to be the case for me... #!/bin/bash -x while read line do f=$(echo $line | tr -s ' ' | cut -d' ' -f 3) echo $f if then echo "This... (2 Replies)
Discussion started by: jnojr
2 Replies
krank(6)																  krank(6)

NAME
Krank - is a game of dexterity where you match stones together. SYNOPSIS
krank krank -f - start in fullscreen mode krank -w - start in windowed mode krank -s 800x600 - start in screen with size 800x600 krank -f -s 800x600 - start in screen with size 800x600 and in fullscreen mode krank -w -s 800x600 - start in screen with size 800x600 and in windowed mode krank -h - display the helpscreen. DESCRIPTION
krank is a game of dexterity, being somewhere between Breakout and billiard, where the aim of each level is to shove floating stones towards compatible static stones. You control a short chain of stones with your mouse to achieve that. Krank contains the following elements: the snake - follows your mouse or the analog stick of your joypad. the balls - move if you touch them with the snake or another ball. the links - are like balls, but they bond together if they touch each other. the stones - never move and do nothing else. the magnets - unmovable themselves, attract everything that moves. the number of circles rotating around them indicates how many items may get captured in them. A magnet will vanish if: - it captured at least as many balls as circles are rotating around it; - all the captured balls have the same color as the magnet; - it stayed for 3 seconds in the above condition. If a magnet is fully loaded, but includes links or balls of a different color, it will explode, but not vanish. the anchors - never move, but bond together with links. the number of circles rotating around them indicates how many links may bond with them. An anchor will vanish if: - it is connected to as many other anchors as circles are rotating around it; - all the connected anchors and links have the same color as the anchor; - all other anchors of the same color are fully connected. If all the above conditions are valid for 3 seconds, those anchors will be removed. If an anchor is connected to another anchor, but the connecting chain includes links of a different color, it will explode, but not vanish. A connection between two links will be broken if one link is touched by a ball or captured by a magnet. For each level you solve, there will be two more levels available to play, so you can skip levels you don't like. AIM
The aim of each level is to remove all anchors and magnets. CONTROLS
<Space> or 'p' or <Pause> - Game pause. <Esc> - Exit from level/game <Shift>+<Esc> - Quick exit <Right Arrow> - Next level <Left Arrow> - Previous Level <PageUp>/<PageDown> - Increase/decrease music volume. <ALT>+<PageUp>/<PageDown> - Increase/decrease sound volume. krank krank(6)
All times are GMT -4. The time now is 08:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy