Sponsored Content
Full Discussion: logic question
Top Forums Shell Programming and Scripting logic question Post 302210733 by unSpawn on Tuesday 1st of July 2008 06:54:23 PM
Old 07-01-2008
Isn't that just comparing? I mean, instead of the balance thing you could do something like:
make array (weigh each ball); testweight is value of balls[0]; unset balls[0]
for item in (sequence of [amount of array items minus 1]); do
if [weight of item] equals testweight then continue
elif [weight of item] greater than testweight then echo item
elif [weight of item] less than testweight then echo testweight
done?
 

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parent/Child Scripting logic Question

I have Parent script that will execute a child script. The child script will take about 2 hours to run and I wanted to somehow build a logic for parent.sh to wait and perform ps -ef|grep cp|grep -v on the child.sh cp process and loop and check return code of child.sh $? as well. Once they are both... (3 Replies)
Discussion started by: jigarlakhani
3 Replies

2. Shell Programming and Scripting

More a logic than a programming question

hello, I'm a littlebit lost... i have a table of single names and combination of two names and i want a table of ALL single names with ALL combinations (also the indirect ones). - - - in reality the names are longer, not only a,b,.. and the table is tab-delimited, and the result table... (6 Replies)
Discussion started by: dietmar13
6 Replies
XmListReplaceItemsPosUnselected(3X)									       XmListReplaceItemsPosUnselected(3X)

NAME
XmListReplaceItemsPosUnselected - A List function that replaces items in a list without selecting the replacement items SYNOPSIS
#include <Xm/List.h> void XmListReplaceItemsPosUnselected (widget, new_items, item_count, position) Widget widget; XmString *new_items; int item_count; int position; DESCRIPTION
XmListReplaceItemsPosUnselected replaces the specified number of items in the list with new items, starting at the given position. The replacement items remain unselected, even if they currently appear in the XmNselectedItems list. Specifies the ID of the List widget to replace items in. Specifies a pointer to the replacement items. Specifies the number of elements in new_items and the number of items in the list to replace. This number must be non-negative. Specifies the position of the first item in the list to be replaced. A value of 1 indicates that the first item replaced is the first item in the list; a value of 2 indicates that it is the second item; and so on. Beginning with the item specified in position, item_count items in the list are replaced with the corresponding elements from new_items. That is, the item at position is replaced with the first element of new_items; the item after position is replaced with the second element of new_items; and so on, until item_count is reached. For a complete definition of List and its associated resources, see XmList(3X). SEE ALSO
XmList(3X) XmListReplaceItemsPosUnselected(3X)
All times are GMT -4. The time now is 08:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy