Search Results

Search: Posts Made By: ankur328
19,680
Posted By RudiC
Try (not thoroughly tested):sed -n...
Try (not thoroughly tested):sed -n '/pattern/{x;n;n};1h;1!{x;p;};${x;p;}' /etc/testfile
2,033
Posted By Scrutinizer
This could be simplified further still: if ls...
This could be simplified further still:
if ls -A "$apache_log_dir"/*.log "$jboss_log_dir"/*.log 1>/dev/null 2>&1; then
2,033
Posted By Don Cragun
Note that if either of those directories are...
Note that if either of those directories are empty, or at least do not contain any files with names ending in .log, the command substitution will print a diagnostic message. You can avoid having...
2,033
Posted By RudiC
Try if [[ $(ls -A $apache_log_dir/*.log...
Try
if [[ $(ls -A $apache_log_dir/*.log $jboss_log_dir/*.log) ]] It will check in both directories for .log files and evaluate to true if a file exists in either.
2,033
Posted By RudiC
If the result is true for the first test, the...
If the result is true for the first test, the second test will not be executed due to "short circuit evaluation".

The egrep seems redundant, what do you expect it to do what a ls *.log would not...
2,799
Posted By pravin27
sed '/\[\/\]/a added' filename
sed '/\[\/\]/a added' filename
2,799
Posted By rdrtx1
try: sed '/[[][/][]]/a added' infile
try:
sed '/[[][/][]]/a added' infile
1,002
Posted By RudiC
I'd propose to use an editor. How frequently do...
I'd propose to use an editor. How frequently do you need to apply that change?
1,409
Posted By anbu23
sed...
sed '/Started_with_Errors/{s/^/===================================================\
/;s/$/\
===================================================/;}' one.txt > two.txt
2,253
Posted By RavinderSingh13
Hello, One more approach for same. ...
Hello,

One more approach for same.



awk -vs1="Server" 'BEGIN{ print s1 "Stopped" } /^[0-9]/ {print} END{print s2 "Started"}' starting_ending_text


Output will be as follows.


...
2,253
Posted By Akshay Hegde
Try something like : $ tail -$(grep -m1 -n...
Try something like :
$ tail -$(grep -m1 -n 'Server Stopped' <(tac file) | cut -d':' -f1) file
Server Stopped
123
456
789
Server Started
2,253
Posted By Klashxx
python shell: >>> import re >>> text = ''' ...
python shell:
>>> import re
>>> text = '''
... Server Stopped
... ABC
... DEF
... GHI
... JKL
... Server Started
... MNO
... PQR
... STU
... Server Stopped
... VWX
... YZ
... ABC
......
2,253
Posted By disedorgue
/Server Stopped/h ==> if line we found 'Server...
/Server Stopped/h ==> if line we found 'Server Stopped', we initialize hold buffer with it.
/Server Stopped/,/Server Started/{/Server Stopped/b,H;} ==> Between lines 'Server Stopped' and 'Server...
2,253
Posted By Yoda
An awk approach: awk ' /Server...
An awk approach:
awk '
/Server Stopped/ {
f = 1
S = $0
next
}
f && !/Server Started/ {
S = S RS $0
...
2,253
Posted By disedorgue
Hi, Another solution with sed: sed -n...
Hi,
Another solution with sed:
sed -n '/Server Stopped/h;/Server Stopped/,/Server Started/{/Server Stopped/b;H;};${x;p;}' file

Regards.
1,231
Posted By gacanepa
Please modify the title of this thread by adding...
Please modify the title of this thread by adding [SOLVED] before the current title, so that this thread will serve as a reference for other users in the future. BTW, glad it worked!
1,970
Posted By rajamadhavan
You can check the source of the page, send the...
You can check the source of the page, send the submit input corresponding to the button with the wget request using --post-data option.
2,028
Posted By rajamadhavan
Pls read this link ...
Pls read this link

http://www.packtpub.com/sites/default/files/downloads/Integration_with_Other_Tools.pdf
1,623
Posted By Skrynesaver
ant (which i assume you're using as it's the most...
ant (which i assume you're using as it's the most common user of build.xml), was deliberately designed as a platform neutral build environment.

simply

cd $directory_with_build.cml_in_it...
Showing results 1 to 19 of 19

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