I forgot to mention it may not always start with aaa for example, it may start with bbb then aaa.
I forgot to mention that to understand the code it is necessary to read the accompanying explanation. To quote from what i have written:
Quote:
Originally Posted by bakunin
You need to fill the arrays with your values correspondingly. If "aaa" is expected to be followed by "bbb" then you need to have "aaa" as array element in achFirst[] and "bbb" as the array element with the same index in achSecond[].
If "aaa" should be followed by "bbb" and "bbb" should be followed by "aaa" the prior quote might serve as a remote indication that
incidentally may do what you want. To answer your question:
Quote:
Originally Posted by mutley2202
Not sure if the above would work based on that.
In general reading and analysing a program helps with understanding how it works. In fact the program can do what you want although it is overly complicated for that purpose because you changed the requirements from:
Quote:
I need to be able to check for the order of the output
to
Quote:
I'm not bothered what the first one is
Before you ask: yes, in fact there is a miniscule difference between "checking the order" and "not checking the order".
I am trying to install GCC-3.1.1 on an SGI Indigo2. I already have MIPSpro 7.2.1 installed. However, when I try to configure GCC-3.1.1, I get the message "cc ERROR: cc -o conftest -g failed, You must set the environment variable CC to a working compiler."
What is the name of the MIPSpro c++... (1 Reply)
I am trying to install GCC-3.1.1 on an SGI Indigo2. I already have MIPSpro 7.2.1 installed. However, when I try to configure GCC-3.1.1, I get the message "cc ERROR: cc -o conftest -g failed, You must set the environment variable CC to a working compiler."
What is the name of the MIPSpro c++... (1 Reply)
I want to set a variable to be any number of dashes. Rather than doing the following:
MYVAR="------------------"
I'd like to be able to set the variable to, say, 80 dashes but don't want to have to count 80 dashes. Is there a way to do this? (2 Replies)
L=0
cat test.sh | while read line
do
L='expr $1 + 1'
echo $L
done
echo $l
>>> the echo $L at the end produces 0 but i actually want it to produce the number of lines - any idea why this is happening? (16 Replies)
How do you set a varible with information that contains a string and also another variable? For example:
subject="Attention: $name / This $type needs your attention"
The $xxxx are of course other variables that I instantiated earlier. Is it like Java where you have to use double quotes and... (1 Reply)
In my script, I have the following command....
du -sk `ls -ltd sales12|awk '{print $11}'`|awk '{print $1}'
it returns the value
383283
I want to modify my script to capture that value into a variable. So, I try doing the following...
var1=`du -sk `ls -ltd sales12|awk '{print... (5 Replies)
I am working within a while loop and i am trying to set a variable that will read out each count of the files. the problem is the count variable i have set up gives me a total and not the individual count of each file. in the data area there is 4 abc.dat and 1 def.dat.
how can i do this???
... (2 Replies)
Hi all,
If anyone has the explanation for the following issue, please share it with me.
I am comparing two variable a and b with the values of 007 and 7, for these values it get evaluated as True. For a=008 and b=8, for these values it get evaluated as false.
#!/bin/tclsh
set a 007 ... (3 Replies)
I'm using clustered zones on my machine. i'm only at the test phase of my design and ultimately the oracle zones will be using VxVM.
When the testing phase is complete, VxVM will be used in the containers. It is necessary for VxVM to run in the global zone for the containers to use it (is... (5 Replies)
Hi all,
Hope someone can help me out here.
I have this BASH script (see below)
My problem lies with the variable path.
The output of the command find will give me several fields. The 9th field is the path. I want to captured that and the I want to filter this to a specific level.
The... (6 Replies)
Discussion started by: Cowardly
6 Replies
LEARN ABOUT X11R4
strtok_r
STRTOK(3) Linux Programmer's Manual STRTOK(3)NAME
strtok, strtok_r - extract tokens from strings
SYNOPSIS
#include <string.h>
char *strtok(char *str, const char *delim);
char *strtok_r(char *str, const char *delim, char **saveptr);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
strtok_r(): _POSIX_C_SOURCE
|| /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
DESCRIPTION
The strtok() function breaks a string into a sequence of zero or more nonempty tokens. On the first call to strtok(), the string to be
parsed should be specified in str. In each subsequent call that should parse the same string, str must be NULL.
The delim argument specifies a set of bytes that delimit the tokens in the parsed string. The caller may specify different strings in
delim in successive calls that parse the same string.
Each call to strtok() returns a pointer to a null-terminated string containing the next token. This string does not include the delimiting
byte. If no more tokens are found, strtok() returns NULL.
A sequence of calls to strtok() that operate on the same string maintains a pointer that determines the point from which to start searching
for the next token. The first call to strtok() sets this pointer to point to the first byte of the string. The start of the next token is
determined by scanning forward for the next nondelimiter byte in str. If such a byte is found, it is taken as the start of the next token.
If no such byte is found, then there are no more tokens, and strtok() returns NULL. (A string that is empty or that contains only delim-
iters will thus cause strtok() to return NULL on the first call.)
The end of each token is found by scanning forward until either the next delimiter byte is found or until the terminating null byte ('