Hi,
I have an array with characters and I am looking for specific character in that array and if those specific character not found than I use goto statment which is define somehwhere in the script. My code is:
Can this be done in one line using awk/sed/grep? That is if this array has characters other than D or F than goto statement should be executed. That is I expect array a with only D and F .
Thank you so much for your help in advance.
Hey Guys.. I just want to know how to use Goto statement in shell scripts.
I know the basic use of statement.
Goto Label
The above statement will search for some label which must be defined in the script itself as:
label:
I tried these combinations but I didn't work out for me and I'm... (7 Replies)
I have a test script for using goto statement but its not working. please help
i tried both in linux and hp-ux it's not working please help
#! /bin/ksh
t=`ps -ef|grep ti.sh|grep -v grep`
if ; then
goto start
else
goto stop
fi
start:
echo "start"
stop:
echo "stop" (5 Replies)
I'm searching the most effective way of doing the following task, so if someone can either provide a working solution with sed or one totally different but more effective then what I've got so far then please go ahead!
The debugme directory has 3 subdirectorys and each of them has one .txt file... (7 Replies)
Hi All,
I need your help in finding pattern from files present in different directories.
I need to search for a pattern "xyz" from "*.txt" files which are present in different levels of directories as shown.
example
-------
dir1/subdir1/file.txt
dir2/subdir2/subsubdir2/file.txt... (5 Replies)
got a file as y.txt
1 abc,def,ghj
2 defj,abc.kdm,ijk
3 lmn,cbk,mno
4 tmp,tmop,abc,pkl
5 pri,chk,cbk,lmo
6 def,cbk.pro,abc.kdm
i want to search in the above file the key word like abc
looking for two outcomes by passing the parameter value as abc into function and the two outocmes are... (6 Replies)
Hi There,
I am trying to load data from a csv file into a DB during our DB migration phase. I am successfully able export all data into a .csv file but those have to rewritten in terms insert statement which will allow for further population of same data in different DB
My exiting csv record... (6 Replies)
Hellow:
I have the following data.
id1 xxx xxx xxx id1 xxxx xxx xxx
id2 xxx xxx xxx id2 xxxx xxx xxx id2
In my awk script which reads the file containing the above data I have the following code:
myline=<inputdata> which is shown above
What I am trying to find out is how may... (5 Replies)
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Hello folks,
I have multiple occurrences of the pattern:
).:
where is any digit, in various text context but the pattern is unique as this regex. And I need to turn this decimal fraction into an integer (corresponding percent value: the range of 0-100).
What I'm doing is:
cat... (1 Reply)
Discussion started by: roussine
1 Replies
LEARN ABOUT ULTRIX
mbstowcs
mbstowcs(3int)mbstowcs(3int)Name
mbstowcs - converts a sequence of multibyte characters into a sequence of characters of type wchar_t.
Syntax
#include <stdlib.h>)
size_t mbstowcs (pwcs, s, n)
wchar_t *pwcs;
const char *s;
size_t n;
Arguments
pwcs The pwcs argument is a pointer to the resulting wide character string.
s The s argument is a pointer to the multibyte character sequence.
n The n argument is the maximum number of resulting wide characters stored in pwcs.
Description
The function converts a sequence of multibyte characters from the array pointed to by s into a sequence of characters of type wchar_t, and
stores not more than n characters into the array pointed to by pwcs. No multibyte characters that follow a null character (which is con-
verted into a code with value zero) are examined or converted. No more than n elements are modified in the array pointed to by pwcs. This
function is affected by the LC_CTYPE category of the current locale.
Return Values
If an invalid multibyte character is encountered, the function returns (size_t) -1. Otherwise, the function returns the number of array
elements modified, not including a terminating null character, if any. The array will not be null-terminated if the value returned is n.
See Alsomblen(3int), mbtowc(3int), setlocale(3int), wctomb(3int), wcstombs(3int)mbstowcs(3int)