Visit The New, Modern Unix Linux Community

Search Results

Search: Posts Made By: Klashxx
1,180
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...
1,407
Posted By Klashxx
Using GNU date: $ date --date="Dec 11"...
Using GNU date:
$ date --date="Dec 11" +"%Y-%m-%d"
2014-12-11
696
Posted By Klashxx
This should work (except for Washington :) ) ...
This should work (except for Washington :) )

grep -v -f Filter.txt Data.txt
2,703
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. :)
2,695
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.
2,504
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...
1,794
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
988
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...
988
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}...
684
Posted By Klashxx
What you done so far ?
What you done so far ?
2,087
Posted By Klashxx
This way: VAR=$(ssh Server "grep 'Listener...
This way:
VAR=$(ssh Server "grep 'Listener stopped' /logs/perf.log")
1,113
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...
854
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...
854
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...
23,778
Posted By Klashxx
To print line after pattern: sed -n...
To print line after pattern:

sed -n '/pattern/{n;p;}' infile
1,793
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
...
1,793
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
1,534
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,270
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...
9,014
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...
9,014
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 =...
1,322
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...
5,966
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 ''
857
Posted By Klashxx
Try: awk 'sub(/~[^~]+~$/,"")' file
Try:
awk 'sub(/~[^~]+~$/,"")' file
1,691
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

 

Featured Tech Videos

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