Search Results

Search: Posts Made By: Simerian
1,673
Posted By Simerian
SED GURUS - Help!
I wish to substituite a string on each line but ONLY if it appears within double-quotes:

this_string="abc#def#geh" # Comment here

I wish to change the "#" characters within the double quoted...
3,124
Posted By Simerian
You are quite correct, hence my earlier statement...
You are quite correct, hence my earlier statement that "arrays within arrays" can be "faked" - I knew that being lazy would get me into trouble!

The point is that the extra dimensions act as array...
3,124
Posted By Simerian
"arrays of arrays" can be "faked" by using...
"arrays of arrays" can be "faked" by using multi-dimensional subscripts.

I'm feeling lazy so that is the extent of my response - sorry!
7,207
Posted By Simerian
Oh yeah, I forgot, you can also "tee" standard...
Oh yeah, I forgot, you can also "tee" standard output to a file to capture screen output as well as displaying it to the monitor. If the permissions on your system are set really insecurely, you can...
7,207
Posted By Simerian
If you are connecting via a telnet (or...
If you are connecting via a telnet (or equivalent) session from Windows then you could use the print screen as you state. If you're doing a lot of it for professional purposes (i.e. training), a...
8,625
Posted By Simerian
yeah..., that is the continuation marker. ...
yeah..., that is the continuation marker.

You can type:

if [[ -f filename]] then [ENTER]
echo "File exists" [ENTER]
else [ENTER]
echo "File does NOT exist" [ENTER]
endif [ENTER]

...and...
5,266
Posted By Simerian
Quick & very dirty solution
I don't have time to write the code for you but you could do the following:

When updating...

grep the file for the original value,

generate new value...

pipe the file through sed and...
6,780
Posted By Simerian
The best shell for all-round programming and...
The best shell for all-round programming and support has to be .ksh

.zsh has more functionality but is not as widely used and so scripts are not as portable. .ksh is King!
3,179
Posted By Simerian
find calling command
find has a command option that allows you to run, for instance, a grep against each file it locates. This is sometimes very useful... You'll have to check the man page for the syntax.
8,625
Posted By Simerian
A couple of options
.ksh

if [[-f filename]] for existence

If I can remember correctly...

if [[-s filename]]for non-empty
3,344
Posted By Simerian
GnuWin32 sed 4.1.4 regexp matching
I am using GnuWin32 sed and am having trouble with the regexp - i.e., they don't behave the same way as in UNIX (POSIX and and all that). I have a stream of data, e.g.:
...
15,620
Posted By Simerian
You could try for variable in $(find) do ...
You could try

for variable in $(find) do
array[counter]=variable
done

You then have an associative array that contains all the values. Obviously you would need to set up a counter for the...
75,284
Posted By Simerian
Do you mean, as an alternative to uname -a?
Do you mean, as an alternative to uname -a?
17,373
Posted By Simerian
egrep will also work with a regexp that matches a...
egrep will also work with a regexp that matches a specific length (i.e. [A-Za-z]{12,12})
1,742
Posted By Simerian
Perhaps the library is in a different location on...
Perhaps the library is in a different location on the Linux machine?
1,995
Posted By Simerian
By "2nd part part of the line", I assume you mean...
By "2nd part part of the line", I assume you mean the 2nd field. As you process each record and the relevant fields, the real issue is the construction of a suitable selection that determines...
2,371
Posted By Simerian
google is correct in that cut is very slow and...
google is correct in that cut is very slow and should be used sparingly in circumstances where extracts need to occur many times. Much better to use a data processing tool such as awk for mass data...
2,371
Posted By Simerian
You might want to use the cut command.
You might want to use the cut command.
3,920
Posted By Simerian
Thanks Perderabo, those pesky semi-colons have a...
Thanks Perderabo, those pesky semi-colons have a mind of their own sometimes! Serves me right for typing it directly into the reply box...

Leo, as was suggested, the idea is not to cut and paste...
8,164
Posted By Simerian
Presumably, you want more than just a listing of...
Presumably, you want more than just a listing of files (which can be produced without the intervention of any scripting language)?

If so, the script is called from a cgi bin and dynamically...
3,920
Posted By Simerian
Of course, if you wished to proceed using solely...
Of course, if you wished to proceed using solely the ksh, you could replace if the many if statements with a case/esac.

Also, I would cut up each record as follows:

cat inputfile | while read...
3,920
Posted By Simerian
Without further information regarding the...
Without further information regarding the problem, it is difficult to determine the amount of processing required for each field in turn. As an example, there may be a need to reformat certain...
3,920
Posted By Simerian
You could run: for Pattern in email name etc...
You could run:

for Pattern in email name etc
do
grep "${Pattern}" in DataFile.txt >${Pattern}.txt
done


...but remember, you may get a 1->many occurence of lines that match more than one...
3,920
Posted By Simerian
... or use awk to pattern matching on the words...
... or use awk to pattern matching on the words and perform a little bit of processing if required (e.g. putting the different matched lines into separate files).
5
Awk
2,414
Posted By Simerian
Some thoughts... 1) First things first, how...
Some thoughts...

1) First things first, how do you identify 87 your fields? Are they delimited or positional?
2) Do you now which fields are dates? If not you will probably have to match against...
Showing results 1 to 25 of 37

 
All times are GMT -4. The time now is 01:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy