I have a logic like this
It initializes the flag variable as "T" at the beginning of the loop everytime
Inside each loop it checks for two conditions and updates the flag variable as "A" or "B"
In the end of the loop it checks for the value of the variable flag for "A" or "B" and execute... (4 Replies)
:)
Hi,
I want to script for this scenerio,
OSR Settings
Scenario : We are looking to find all the *.a files from the following locations in the filesystem of a server.
OSR Directories
/etc
/bin
/usr/bin
/usr/sbin
/var/adm
These *.a files should have the permissions on... (12 Replies)
Hi all,
I am using the below given sqlplus command in my unix script to invoke a stored procedure which returns a value .It works fine.
RET_CODE=$(/opt/oracle/product/10.2.0.4.CL/bin/sqlplus -S $USER/$PASSWD@$DB_NAME <<EOF
EXEC MY_PKG.MY_SP (:COUNT);
PRINT COUNT;
commit;
... (6 Replies)
Hi all,
ssh uname@remote_server 'cat /tmp/remote_file_name > home_dir/a512386/new/local_file_name'
The above given command is working fine.
but if i try to move the file only if exists in the remote server i.e) giving the same within if condition it executes but the file is not stored in my... (1 Reply)
Hi,
I am in trouble. I can get inside my condition test inside a loop :
I am in ksh (solaris)
while read file
do
<commande to retrieve file> >> ${LOG_RETRIEVE_FILE.log}
msg_err=$(cat ${LOG_RETRIEVE_FILE.log} | grep "error retrieve")
if ; then
<sendmail>
exit 1
fi
done
I tried... (6 Replies)
Hi All,
I want to change the name as SEQ_13
ie., <Property Name="Name">SEQ_13</Property>
when the Stage Type is PxSequentialFile
ie., <Property Name="StageType">PxSequentialFile</Property> :wall:
Input.XML
<Main>
<Record Identifier="V0S13" Type="CustomStage" Readonly="0">... (3 Replies)
This is what I have so far
grep -lir "some text" *
I need to check all files on the system for this text, if the text is found I need to change the file permissions so only ROOT has read and write access.
How can this be done? (3 Replies)
Hello experts,
I'm stuck with this script for three days now. Here's what i need.
I need to split a large delimited (,) file into 2 files based on the value present in the last field.
Samp: Something.csv
bca,adc,asdf,123,12C
bca,adc,asdf,123,13C
def,adc,asdf,123,12A
I need this split... (6 Replies)
I want to check if the string has the substring in IF condition then process...
i tried below but not working
if ];
then
.............
field can be "reserved1" ....reservedn / fillspaces1 ... fillspacesn (4 Replies)
Hi,
I need to perform the untar and rm operation if the file found is a .tar and does not have test.tar or hello.tar as the file names.
Below is the loop to check the same.
for tf in *.tar
do if ]
then found=1
... (1 Reply)
Discussion started by: mohtashims
1 Replies
LEARN ABOUT FREEBSD
strtok
STRTOK(3) BSD Library Functions Manual STRTOK(3)NAME
strtok, strtok_r -- string tokens
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <string.h>
char *
strtok(char *str, const char *sep);
char *
strtok_r(char *str, const char *sep, char **last);
DESCRIPTION
This interface is obsoleted by strsep(3).
The strtok() function is used to isolate sequential tokens in a null-terminated string, str. These tokens are separated in the string by at
least one of the characters in sep. The first time that strtok() is called, str should be specified; subsequent calls, wishing to obtain
further tokens from the same string, should pass a null pointer instead. The separator string, sep, must be supplied each time, and may
change between calls.
The implementation will behave as if no library function calls strtok().
The strtok_r() function is a reentrant version of strtok(). The context pointer last must be provided on each call. The strtok_r() function
may also be used to nest two parsing loops within one another, as long as separate context pointers are used.
The strtok() and strtok_r() functions return a pointer to the beginning of each subsequent token in the string, after replacing the token
itself with a NUL character. When no more tokens remain, a null pointer is returned.
EXAMPLES
The following uses strtok_r() to parse two strings using separate contexts:
char test[80], blah[80];
char *sep = "\/:;=-";
char *word, *phrase, *brkt, *brkb;
strcpy(test, "This;is.a:test:of=the/string\tokenizer-function.");
for (word = strtok_r(test, sep, &brkt);
word;
word = strtok_r(NULL, sep, &brkt))
{
strcpy(blah, "blah:blat:blab:blag");
for (phrase = strtok_r(blah, sep, &brkb);
phrase;
phrase = strtok_r(NULL, sep, &brkb))
{
printf("So far we're at %s:%s
", word, phrase);
}
}
SEE ALSO memchr(3), strchr(3), strcspn(3), strpbrk(3), strrchr(3), strsep(3), strspn(3), strstr(3), wcstok(3)STANDARDS
The strtok() function conforms to ISO/IEC 9899:1990 (``ISO C90'').
AUTHORS
Wes Peters <wes@softweyr.com>, Softweyr LLC
Based on the FreeBSD 3.0 implementation.
BUGS
The System V strtok(), if handed a string containing only delimiter characters, will not alter the next starting point, so that a call to
strtok() with a different (or empty) delimiter string may return a non-NULL value. Since this implementation always alters the next starting
point, such a sequence of calls would always return NULL.
BSD November 27, 1998 BSD