04-19-2012
in sed command use a double quote instead a single quote.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
This may be the 3rd time I'm posting this question. I'm so new here that I'm not even sure how to post!
I'm trying to compare two files but can't do a line by line comparison so comm and diff are out. I've been told that I would need to use the awk programing language. I've looked up what I... (14 Replies)
Discussion started by: jimmyflip
14 Replies
2. Shell Programming and Scripting
Hi Guys,
What is the most effecient way to compare the content of 2 seperate files and extract the result of there is a match? We have 2 separate log files and we are trying to find the common errors from the 2 files.
Thanks,
Odogbolu98
:( (3 Replies)
Discussion started by: odogbolu98
3 Replies
3. Shell Programming and Scripting
I know the diff does this but it does output more info than just the different text
(e.g.
$ diff file1 file2
29a30
> /home/alex/Pictures/hello.jpg
1694a1696
> /home/alex/Pictures/hi.jpg
)
How can I make it output only
/home/alex/Pictures/hello.jpg
/home/alex/Pictures/hi.jpg
?
thank... (2 Replies)
Discussion started by: hakermania
2 Replies
4. Shell Programming and Scripting
Hi Team,
Could you please help me on below one ..
etrademail1.txt
etDefaultLogin=pdayanan
mail=poojaaragam.dayanand@exchange.etr.comx
employeeNumber=31567
etDefaultLogin=sudrupa
mail=sudrupa.ayanand@exchange.etr.comx
employeeNumber=318967
etDefaultLogin=gurathi (1 Reply)
Discussion started by: nivas_k2006
1 Replies
5. Shell Programming and Scripting
$ cat File1
Non HTTP response code:java.net.ConnectException225073X
000000005143329Load time: 402335410224
Non HTTP response code: ava.net.ConnectException206423X
000000005143330Load time: 402305687161
Non HTTP response code: ava.net.ConnectException290212X
000000005143331Load time:... (1 Reply)
Discussion started by: ooilinlove
1 Replies
6. Shell Programming and Scripting
Hello everyone,
I work under Ubuntu 11.10 (c-shell)
I need a script to create a new text file whose content is the text of another text files that are in the directory $DIRMAIL at this moment.
I will show you an example:
- On the one hand, there is a directory $DIRMAIL where there are... (1 Reply)
Discussion started by: tenteyu
1 Replies
7. UNIX for Dummies Questions & Answers
Hello guys,
I have file1 and file2, two text files containing various lines.
I'm trying to find a way to compare file1 and file2:
If the first 7 characters of a line in file2 match the first 7 characters of a line in file1, then do not do anything.
Print out the lines of file1 (in file3,... (3 Replies)
Discussion started by: bobylapointe
3 Replies
8. Shell Programming and Scripting
i am working on a shell script and need help in the comparing part of it. for e.g. there two text files like this:
file1.txt
name1
name2
name3
file1 has to be comared with file2
defaultfile.txt
name1
name2
name3
name4
and during comparision with defaultfile.txt
if... (2 Replies)
Discussion started by: draghun9
2 Replies
9. Shell Programming and Scripting
Hi,
I have two text files, compare column one in both the files and if it matches then the output should contain the id in column one, the number and the description.
Both the files are sorted. Is there a one liner to get this done, kindly help. Thank you
File 1:
NC_000964 92.33 ... (2 Replies)
Discussion started by: pulikoti
2 Replies
10. Shell Programming and Scripting
I have two files in unix environment with similer type of contain:
Example:
File1 File2
Milestone1 Milestone1
Milestone2 Milestone12
Milestone3 Milestone13... (11 Replies)
Discussion started by: Mrinal Mondal
11 Replies
LEARN ABOUT CENTOS
ao_string_tokenize
ao_string_tokenize(3) Programmer's Manual ao_string_tokenize(3)
NAME
ao_string_tokenize - tokenize an input string
SYNOPSIS
#include <your-opts.h>
cc [...] -o outfile infile.c -lopts [...]
token_list_t* ao_string_tokenize(char const* string);
DESCRIPTION
This function will convert one input string into a list of strings. The list of strings is derived by separating the input based on white
space separation. However, if the input contains either single or double quote characters, then the text after that character up to a
matching quote will become the string in the list.
The returned pointer should be deallocated with free(3C) when are done using the data. The data are placed in a single block of allocated
memory. Do not deallocate individual token/strings.
The structure pointed to will contain at least these two fields:
tkn_ct The number of tokens found in the input string.
tok_list An array of tkn_ct + 1 pointers to substring tokens, with the last pointer set to NULL.
There are two types of quoted strings: single quoted (') and double quoted ("). Singly quoted strings are fairly raw in that escape char-
acters () are simply another character, except when preceding the following characters:
double backslashes reduce to one
' incorporates the single quote into the string
0fP suppresses both the backslash and newline character
Double quote strings are formed according to the rules of string constants in ANSI-C programs.
string string to be tokenized
RETURN VALUE
pointer to a structure that lists each token
ERRORS
NULL is returned and errno will be set to indicate the problem:
EINVAL - There was an unterminated quoted string.
ENOENT - The input string was empty.
ENOMEM - There is not enough memory. @end itemize
EXAMPLES
#include <stdlib.h>
int ix;
token_list_t* ptl = ao_string_tokenize(some_string)
for (ix = 0; ix < ptl->tkn_ct; ix++)
do_something_with_tkn(ptl->tkn_list[ix]);
free(ptl);
Note that everything is freed with the one call to free(3C).
SEE ALSO
The info documentation for the -lopts library.
configFileLoad(3), optionFileLoad(3), optionFindNextValue(3), optionFindValue(3), optionFree(3), optionGetValue(3), optionLoadLine(3),
optionMemberList(3), optionNextValue(3), optionOnlyUsage(3), optionProcess(3), optionRestore(3), optionSaveFile(3), optionSaveState(3),
optionUnloadNested(3), optionVersion(3), strequate(3), streqvcmp(3), streqvmap(3), strneqvcmp(3), strtransform(3),
2014-06-10 ao_string_tokenize(3)