I tried the following example to get the last 6 characters from a string
What chages i need to do to get the first 6 characters from the string
my desired output should be abcdef
I want to grep from a file an exact character match.
I tried grep -c "$a $b" $file
where a=6 and b=2
the problem is that I get: 6 2 and 6 20
I just need a count of the occurrence.
I'm using the Bourne shell.
I've also tried grep -c '$a $b' $file;
not sure how to do this - any suggestions? (3 Replies)
Hi Folks,
I have this windowed applescript application I use for sending out emails, it uses the Postfix daemon buit into my Mac Os X box, and a 3 SMTP servers (out of hundreds I send emails to) were refusing my messages replying "host smtp2.braspress.com.br said: 550 Requested action not... (2 Replies)
Please help. This simple problem is really stumping me.
Is there are way to find absolute pathnames for all files on your system that are longer than 100 characters?
I'm using bash shell to attempt it, but have come up with nothing so far.
I appreciate any help offered.
Nauty (2 Replies)
I have a file sample.txt with the below contents:
Aaa - providioning add ||
dev - reeec
dev kapl ||
ball - HERO ||
bal - provisioning pro ||
for given name i need the output to be the contents between - and || (excluding both)
for eg : input - Aaa
output -... (10 Replies)
Hi,
Is there anyway to find the junk characters in a file.Consider the file has data as given below:
123|abc^M|Doctor^C #record 1
234|def|Med #record 2
345|dfg^C|Wrong^V #record 3
The junk characters are highlighted and this is a pipe delimited file.
Is there anyway to... (20 Replies)
Hi, I have a series of files (upwards of 500) the filename format is as follows
CC10-1234P1999.WGS84.p190
each of this files is in a directory named for the file but excluding the extension.
Now the last three numeric characters, in this case 999, can be anything from 001 to 999, I need to... (3 Replies)
Hi, I have a series of files (upwards of 500) the filename format is as follows
CC10-1234P1999.WGS84.p190, all in one directory.
Now the last three numeric characters, in this case 999, can be anything from 001 to 999.
I need to move some of them to a seperate directory, the ones I need to... (5 Replies)
After spending sometime playing around with my script I just cannot get it to do what I want. So I decided to ask. My file looks something like this:
I am using the following code to extract sequences that contain dashes
awk '/^>/{id=$0;next}{if (match($1,"-")) print id "\n" $0}' infile
... (17 Replies)
Hi All,
Assuming i have got a file test.dat which has contains as follows:
Unix = abc def fgt jug
111 2222 3333
Linux = gggg pppp qqq
C# = ccc ffff llll
I would like to traverse through the file, get the 1st occurance of "=" and then need to get the sting... (22 Replies)
Hi....I need one help....
I'm having a files which is having the data as follows...
a
b
c c
d d d
e
f
Now I need to find out distinct characters from this file and the output should be as follows -
a
b
c
d
e
f
Can you please help me on this? I'm using KSH script. (18 Replies)
Discussion started by: Krishanu Saha
18 Replies
LEARN ABOUT SUNOS
wscol
wstring(3C) Standard C Library Functions wstring(3C)NAME
wstring, wscasecmp, wsncasecmp, wsdup, wscol - Process Code string operations
SYNOPSIS
#include <widec.h>
int wscasecmp(const wchar_t *s1, const wchar_t *s2);
int wsncasecmp(const wchar_t *s1, const wchar_t *s2, int n);
wchar_t *wsdup(const wchar_t *s);
int wscol(const wchar_t *s);
DESCRIPTION
These functions operate on Process Code strings terminated by wchar_t null characters. During appending or copying, these routines do not
check for an overflow condition of the receiving string. In the following, s, s1, and s2 point to Process Code strings terminated by a
wchar_t null.
wscasecmp(), wsncasecmp()
The wscasecmp() function compares its arguments, ignoring case, and returns an integer greater than, equal to, or less than 0, depending
upon whether s1 is lexicographically greater than, equal to, or less than s2. It makes the same comparison but compares at most n Process
Code characters. The four Extended Unix Code (EUC) codesets are ordered from lowest to highest as 0, 2, 3, 1 when characters from different
codesets are compared.
wsdup()
The wsdup() function returns a pointer to a new Process Code string, which is a duplicate of the string pointed to by s. The space for the
new string is obtained using malloc(3C). If the new string cannot be created, a null pointer is returned.
wscol()
The wscol() function returns the screen display width (in columns) of the Process Code string s.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO malloc(3C), string(3C), wcstring(3C), attributes(5)SunOS 5.10 29 Dec 1996 wstring(3C)