Search Results

Search: Posts Made By: majormark
7,007
Posted By majormark
Looks like you missed the closing "`".
Looks like you missed the closing "`".
4,008
Posted By majormark
thank you alister, the -np option works!
thank you alister, the -np option works!
4,008
Posted By majormark
wget a directory structure question
Can you tell me how to download the directory tree just starting from "project1/" in this URL?

"https://somesite.com/projects/t/project1/"

This command does not seem to do what I want as it...
3,038
Posted By majormark
About awk conditions
Hello,

Can you explain why in the first 2 commands the awk does not print anything? Is it looking of a specific format ?

Thanks.


$ echo 12a3 | awk '($1>=2) {print $1}' # prints nothing
$...
1,530
Posted By majormark
You can put the first line in an array and than...
You can put the first line in an array and than take the first "word" beginning with the second line and compare it against each element.
1,464
Posted By majormark
Instead of removing each element, you can 'clean...
Instead of removing each element, you can 'clean up' the array by re-assignation
my @array1;
$array1[1]=11;
print "before: $#array1\n";
my @array2;
@array1=@array2;
print "after:...
16,688
Posted By majormark
@dennis.jacob, edidataguy : I need to remove...
@dennis.jacob, edidataguy :

I need to remove the begin-end pattern: "^[[<NR>m ..... ^[[<NR>m$" for each line in the file not the ESCape char.

Of course ^[[... are special formatting characters...
16,688
Posted By majormark
^ It does not work with "sed -i .." and not even...
^ It does not work with "sed -i .." and not even with /usr/xpg4/bin/sed because I'm on a Solaris machine.
1,120
Posted By majormark
Is this what you wanted? echo 'Rightrs1 a b...
Is this what you wanted?

echo 'Rightrs1 a b c d e f g' | cut -b6-6666 | awk '{print $1 " newFiled " $NF}'
rs1 newFiled g
16,688
Posted By majormark
How to remove special characters from each line?
Hello,

Is there a simpler way to remove special characters (color codes) from each lines in a log file?

I use sed like in the example below but I think there should be a more simple way to...
2,405
Posted By majormark
It's not possible to change that log structure...
It's not possible to change that log structure because I don't have control over it.
2,405
Posted By majormark
AWK optimization
Hello,

Do you have any tips on how to optimize the AWK that gets the lines in the log between these XML tags?

se2|6|<ns1:accountInfoRequest xmlns:ns1="http://www.123.com/123/
se2|6|etc2">
...
6,578
Posted By majormark
awk -F'|' '{print $1 "|" $2 "| 9999 |" $4 "|" $5...
awk -F'|' '{print $1 "|" $2 "| 9999 |" $4 "|" $5 }'
3,116
Posted By majormark
Run the code below from a script with the...
Run the code below from a script with the parameters like this: "start" "end" "search string".

cat your_log_file | awk "/01\/29\/09 0$1:20:39/,/01\/29\/09 0$2:10:39/{print}" | awk "/$3/{print}"
3,853
Posted By majormark
AWK alias with parameters
Hello,

How can I make an alias of an AWK one liner that prints specific lines from a file like below?

# from a command like this:
awk 'NR == 100, NR == 150' file.cfg

The alias I want to...
3,366
Posted By majormark
This is partially what I wanted, thank you for...
This is partially what I wanted, thank you for the tips.

What I need is to use the variable inside the function itself not outside.

For example:

set_elms_n(){ elm_n=$(eval echo...
2,742
Posted By majormark
echo '1,aa ,21, 22' | sed 's/ //g' 1,aa,21,22
echo '1,aa ,21, 22' | sed 's/ //g'

1,aa,21,22
3,366
Posted By majormark
Tricky array substitution in functions
Hello,

Please tell me if there is a better way to get the number of elements from an array that is passed to a function.

This is what works on Solaris 8 (ksh) but it looks odd:

loop_array()...
6,816
Posted By majormark
AWK to skip comments in XML file
Hello,

I'm trying to make a shell script to skip comments from an XML file, but with the code below only deletes comments that are in one line.

Can you tell me what can be added here?

nawk '...
4,759
Posted By majormark
I think you can do an infinite loop with awk and...
I think you can do an infinite loop with awk and at some interval check to see if the last line from the log file has a greater line number than the one you previously checked.

use the NR in awk.
2,255
Posted By majormark
replaces all "/" characters with "_" for every...
replaces all "/" characters with "_" for every line that starts with "."
7,063
Posted By majormark
Thank you very much era :)
Thank you very much era :)
7,063
Posted By majormark
It works, thank you. One more question about...
It works, thank you.

One more question about this tag:

How can I make this variable substitution inside EOF?
$newv and ${newv} are interpreted literally


for i in `cat textfile`
do
...
7,063
Posted By majormark
Yes, but the query I'm giving will be more...
Yes, but the query I'm giving will be more complex and will output many rows.

The "echo $var" will suppress all of them in only one row.

I need a way to output the result as it is displayed on...
7,063
Posted By majormark
What I'm after is something like this(which does...
What I'm after is something like this(which does not work of course):


sqlplus -s <<'__EOF'
connect / as sysdba
select sysdate from dual;
quit;
__EOF >> file_to_output.txt # (or | awk...
Showing results 1 to 25 of 38

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