Search Results

Search: Posts Made By: Klashxx
2,084
Posted By Klashxx
This sed may help: $ sed -r...
This sed may help:
$ sed -r "s/([0-9]{1,})(_{,1})[a-zA-Z]{3}(_{,1})([0-9]{1,})/\1\2xxx\3\4/g" infile
563MS333_101_xxx_400-100_screening
563MS333_104-525_xxx_525_screening...
2,368
Posted By Klashxx
Using GNU date: $ date --date="Dec 11"...
Using GNU date:
$ date --date="Dec 11" +"%Y-%m-%d"
2014-12-11
2,185
Posted By Klashxx
This should work (except for Washington :) ) ...
This should work (except for Washington :) )

grep -v -f Filter.txt Data.txt
4,370
Posted By Klashxx
Just enclose the var in quotes: awk -v...
Just enclose the var in quotes:
awk -v var="`cat kk2 |grep "Makarand"`" 'BEGIN { if (var != "") {print var;exit;}}'

As @pilnet101 points , your code is getting messy. :)
5,207
Posted By Klashxx
It's looking for the file in the remote machine...
It's looking for the file in the remote machine ,never gonna work.
3,990
Posted By Klashxx
Try this: #!/bin/bash typeset -i interval=5 ...
Try this:
#!/bin/bash
typeset -i interval=5
run=true
trunk=vonage
reboot=0
while [[ "$run" == "true" ]]; do
checktrunk=$(asterisk -rx "sip show peer $trunk" | grep -c "Status.*OK")
if...
3,006
Posted By Klashxx
Not tested but try to add retserverror to your...
Not tested but try to add retserverror to your isql command:
isql -Uxyz -SSYB_LOCOMOTIVE_xx -Pabc -Dlmn -w300 -o$sumOfJEOutputFile --retserverror
1,994
Posted By Klashxx
Remove tee and try again: sftp -v -oport=nn...
Remove tee and try again:
sftp -v -oport=nn $FTP_USER@$FTP_HOST <<EOF 2>&1
cd ${TGT_FOLDER_NAME}
lcd ${SRC_FOLDER_NAME}
put ${FNAME}
EOF
if [ $? -ne 0 ];then
echo "sftp fails"
exit
fi...
1,994
Posted By Klashxx
Capture sftp exit code: ls $FILE_NAME | while...
Capture sftp exit code:
ls $FILE_NAME | while read FNAME
do
sftp -v -oport=nn $FTP_USER@$FTP_HOST <<EOF 2>&1 | tee -a ${LOG_FILE_NAME}
cd ${TGT_FOLDER_NAME}
lcd ${SRC_FOLDER_NAME}
put ${FNAME}...
1,231
Posted By Klashxx
What you done so far ?
What you done so far ?
3,825
Posted By Klashxx
This way: VAR=$(ssh Server "grep 'Listener...
This way:
VAR=$(ssh Server "grep 'Listener stopped' /logs/perf.log")
1,638
Posted By Klashxx
If pkill is avaliable. First: store your pid. ...
If pkill is avaliable.
First: store your pid.
#!/bin/bash
switch.sh &
echo $! >/path/to/pid.file
Second: if still alive use pkill:
-P ppid,...
Only match processes whose...
1,281
Posted By Klashxx
Of course , the line variable only gets value...
Of course , the line variable only gets value after the first iteneration of the loop, in other words the first line is printed in the second iteration and so on.

Finally the penultimate line will...
1,281
Posted By Klashxx
Do not load it in memory, try: open ( FA,...
Do not load it in memory, try:
open ( FA, "$fileA" ) || die("can't open fileA $!");
open ( FB, "$fileB" ) || die("can't open fileB $!");
open ( TMP, ">> tmp_file" ) || die("can't open tmp_file...
46,834
Posted By Klashxx
To print line after pattern: sed -n...
To print line after pattern:

sed -n '/pattern/{n;p;}' infile
4,800
Posted By Klashxx
Nice & clean @Yoda , just one point i .. i would...
Nice & clean @Yoda , just one point i .. i would use next to avoid the second matching this way:
awk '
/>/ {
$0 = ( NR == 1 ? $0 : RS $0 RS )
print
...
4,800
Posted By Klashxx
An awk: awk '{ORS=/^>/?"\n":"";print}' infile ...
An awk:
awk '{ORS=/^>/?"\n":"";print}' infile

If you have a multiple set file (and adding last rc as @RudiC proposes):
awk '{ORS=sub(/^>/,"\n>")?"\n":"";print}END{print "\n"}' infile
3,290
Posted By Klashxx
Add tou your ssh: -o ConnectTimeout=n Where n...
Add tou your ssh:
-o ConnectTimeout=n
Where n is compute as seconds.
1,922
Posted By Klashxx
Use: while read LINE do echo "line is" ...
Use:
while read LINE
do
echo "line is"
if [ -n $LINE ]
then
echo "line is $LINE"
echo " "
Y=${#fileclob}
if [ $Y = 0 ]
then
fileclob=$LINE
echo "fileclob_1...
18,132
Posted By Klashxx
Hi @wisecracker, i just wanted tho show a...
Hi @wisecracker, i just wanted tho show a practical usage of look-ahead/behid assertion, for me the important thing here is not the print statement and of course i can't guarantee python in all *nix...
18,132
Posted By Klashxx
This could be done by using look-behind and...
This could be done by using look-behind and look-ahead regexp.
A python example:
>>> import re
>>> text =...
2,286
Posted By Klashxx
A python: # cat test.py #!/usr/bin/env python...
A python:
# cat test.py
#!/usr/bin/env python
import re

text = '''root 25 oracle 25 batch 30 griduser 32 admin 35
root 25 oracle 25 batch 30 griduser 32
oracle 25 batch 30 griduser 32...
7,975
Posted By Klashxx
If null fields still a problem you can bypass the...
If null fields still a problem you can bypass the problem easily setting a fixed value for them:
SET NULL ''
1,705
Posted By Klashxx
Try: awk 'sub(/~[^~]+~$/,"")' file
Try:
awk 'sub(/~[^~]+~$/,"")' file
3,412
Posted By Klashxx
First: use code tags por your sample code. ...
First: use code tags por your sample code.

This is the correct way for your needs:
import glob
text = 'abc*'
same_name_files = glob.glob(text)
Showing results 1 to 25 of 500

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