Search Results

Search: Posts Made By: andyatit
1,247
Posted By andyatit
Pattern match and replace indirect directory reference using sed
Hi,

I need a ksh script to replace indirect directory references in an .ini file with a env variable using sed or awk.

The .ini file is for example as such:


A=..
B=../
C=../..
D=../../...
1,882
Posted By andyatit
Thanks, very useful.
Thanks, very useful.
3,637
Posted By andyatit
Thanks, thats great ! Very neat.
Thanks, thats great ! Very neat.
3,637
Posted By andyatit
sed multiple multi line blocks of text containing pattern
Hi,

I have a log file which has sessionids in it, each block in the log starts with a date entry, a block may be a single line or multiple lines. I need to sed (or awk) out the lines/blocks with...
1,882
Posted By andyatit
Hi, How would you do that ?
Hi,

How would you do that ?
4,436
Posted By andyatit
Fantastic, thank you both. Reducing the label...
Fantastic, thank you both. Reducing the label and splitting the '"$line"' worked great thanks. A great help, much appreciated.
4,436
Posted By andyatit
Hi, sorry, didn't realise I'd not worded it...
Hi, sorry, didn't realise I'd not worded it right, but thanks I'll bear it mind next time.

I'm using SunOS 5.10
not sure how to get more version info about sed than that

I put in as Bakunin...
4,436
Posted By andyatit
sed - append line after block
Hi, I posted in another section, but no reply yet.

I have an ini file with sections denoted as follows (for example)


[SECTION_1]
blah=blah
blee=blee
bloo=bloo

[SECTION_2]
blur=blur...
2,947
Posted By andyatit
sed - Add a variable line to the end of a block beginning with a regex
Hi,

Need some help with sed.

I have a file that has sections :

e.g.

[section]
a=blah
b=blah

[section2]
d=blah
e=blah



There's many sections in the file.
7,085
Posted By andyatit
ah, sorry, yes, I updated the code inbetween...
ah, sorry, yes, I updated the code inbetween posting originally and trying to get it right

Now I have :


select choice in $opt1 "$opt2" "$opt3" "$opt4";do

which gives :


1) dir1
2)...
7,085
Posted By andyatit
Thanks but didn't help pinpoint what quotes I...
Thanks but didn't help pinpoint what quotes I need around which variables..

The problem (as I see it, perhaps I'm looking at it wrong) is that I have say for example for variables being passed in...
7,085
Posted By andyatit
I created some test dirs and so the example...
I created some test dirs and so the example output with say a base dir structure of (using find) :

.
./dir1
./dir1/script2.sh
./dir1/script1.sh
./dir2

first iteration produces :


...
7,085
Posted By andyatit
Select command with variable options having spaces or null contents
Hi,

I'm having an issue trying to produce a hierarchical directory menu that has either any directories listed in a specific directory as options or options with spaces in the option content or...
9,934
Posted By andyatit
there's no --reference option in chmod... ??
there's no --reference option in chmod... ??
9,934
Posted By andyatit
sed a file and maintain date stamp and permissions
I need to alter a file.
I'm using sed then passing output to temp file
then using touch -r to maintain the date but the permissions do not get preserved
How can I sed a file and maintain date and...
12,159
Posted By andyatit
Ahhhhh. ofcourse ! Thank you :)
Ahhhhh. ofcourse ! Thank you :)
12,159
Posted By andyatit
Hi, thanks for suggestion but there's also the...
Hi, thanks for suggestion but there's also the possibility I'll need to gzgrep a compressed file in a tar file

eg:

tar -xOf $tarFile $gzFile|gzgrep -n -f $patternFile

but obviously the...
12,159
Posted By andyatit
gzgrep for multiple patterns or with pattern file
Hi,

I'm struggling to find an option for gzgrep to grep compressed files for multiple patterns preferanly using a pattern file (so pattern file can be altered seperately to rest of script).
...
52,325
Posted By andyatit
unzip single file in zip file to STDOUT
Hi,

Does anyone know if there is an unzip command similar to

tar -xOf $tarBall $fileInTarFile

which will untar a single file in a tar ball to STDOUT ?
I want to do the same but with a...
29,319
Posted By andyatit
Find all tar and compressed file
Hi,

I'm trying to find all tar and compressed files (say gzip). I'm having to assume that the tar and gzip files may or may not have the correct extension (.tar .gz .tgz etc).

Any help...
8,685
Posted By andyatit
gzgrep -l "pattern" *.zip
gzgrep -l "pattern" *.zip
Showing results 1 to 21 of 21

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