09-24-2009
Substring operation in kshell
Hi,
Please let me know how to perform the substring operation in kshell.
If i have line like below
238923893282389034893489458945904589045454903490
i would like to retrieve the position 7 to 19, how to do this in kshell?
10 More Discussions You Might Find Interesting
1. AIX
Hello everyone,
I have a script thats acting funky, what I would like to do is report to a file, how long its taking to get to certain area's, in seconds. For example.
-- Start timer
-- Run unix command 1
-- Run unix command 2
-- Stop timer
-- Report Seconds
-- etc etc
Is there a way... (3 Replies)
Discussion started by: dbridle
3 Replies
2. UNIX for Dummies Questions & Answers
Hi,
Is it possible to initialise a shell variable and set it to a value from an awk command?
i.e.
#set myvalue = to the first 8 charachters of the line that begins with 0
myvalue = awk '/^0/ {substr($0,1,8)}' myvaluefile
or even declare a variable, then reinitialise it as part of the... (1 Reply)
Discussion started by: kshelluser
1 Replies
3. Shell Programming and Scripting
hi
i wrote a script in shell script(ChangeFiles.sh), now i need to run the script in korn shell.
could anyone explain how to run the same script korn shell.
thanks in advance
Satya (2 Replies)
Discussion started by: Satyak
2 Replies
4. Shell Programming and Scripting
Hi All,
Input=abcDEF_1.6k1
I need to use ‘sed' command to get 1.6 value and store to some variable from the given input.
Please help me in getting the command.
Regards,
Kalai (2 Replies)
Discussion started by: kalpeer
2 Replies
5. Shell Programming and Scripting
Hi,
I wrote a small shell script which had function C_fun() and script name is same C_fun.ksh
Here is the program inside the script
#!bin/ksh -x
C_fun() {
typeset TEXT=${1}
}
echo Value of TEXT $TEXT
When Im running the above script with Parameter "R" as the option .... (6 Replies)
Discussion started by: somu_june
6 Replies
6. Shell Programming and Scripting
Hi,
I would like to know if the parameter i am passing to a shell script is contain
the following charachter : ASM.
I belive that i should use regular expresion here.
Can one help ?
Bellow is the "if statment" i need to fix with the reg exp:
if ; then
#echo "IT IS AN RDBMS... (4 Replies)
Discussion started by: yoavbe
4 Replies
7. Linux
hi all,
i am using a Ubuntu work station. i have following piece of code that works ok. But i cant figure out a way to insert a string call $Name into the title of the window i am opening. As you can see, i tried two different ways without a success. Can someone please help me out here? :(
... (3 Replies)
Discussion started by: usustarr
3 Replies
8. Shell Programming and Scripting
I have a txt file with several columns and i want to peform an operation on two columns and output it to a new txt file .
file.txt
900.00000 1 1 1
500.00000
500.00000
100000.000
4
4
1.45257346E-07 899.10834 ... (4 Replies)
Discussion started by: shashi792
4 Replies
9. UNIX for Dummies Questions & Answers
Hi all,
I have a series of directories which i open regularly. I want create an alias so that i can pass the direcotry name to alias and then this commands makes Cd to the path i need. COuld you please help on how to create an alias
ex of what i am trying but couldn't succeeded
#alias... (1 Reply)
Discussion started by: firestar
1 Replies
10. Shell Programming and Scripting
I am an AIX noobie, and have a question around an AIX 5.2 script that I need to run. Security Audit requires us to have no World Writable files on our server, but every time we restart the Domino server on AIX it re-flags two files as World Writable.
I have a little script that I created that... (5 Replies)
Discussion started by: Nebs
5 Replies
LEARN ABOUT OPENDARWIN
memmem
MEMMEM(3) Linux Programmer's Manual MEMMEM(3)
NAME
memmem - locate a substring
SYNOPSIS
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <string.h>
void *memmem(const void *haystack, size_t haystacklen,
const void *needle, size_t needlelen);
DESCRIPTION
The memmem() function finds the start of the first occurrence of the substring needle of length needlelen in the memory area haystack of
length haystacklen.
RETURN VALUE
The memmem() function returns a pointer to the beginning of the substring, or NULL if the substring is not found.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+----------+---------------+---------+
|Interface | Attribute | Value |
+----------+---------------+---------+
|memmem() | Thread safety | MT-Safe |
+----------+---------------+---------+
CONFORMING TO
This function is not specified in POSIX.1, but is present on a number of other systems.
BUGS
In glibc 2.0, if needle is empty, memmem() returns a pointer to the last byte of haystack. This is fixed in glibc 2.1.
SEE ALSO
bstring(3), strstr(3)
COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
GNU
2017-03-13 MEMMEM(3)