Search Results

Search: Posts Made By: aigles
8,281
Posted By aigles
A possible solution : $ cat ./eshaqur.sh awk...
A possible solution :
$ cat ./eshaqur.sh
awk '
function printValues() {
if (Values) {
print S, Date, Value["NSMSSMRLTOT"],
...
2,304
Posted By aigles
Try : psef=`ps -ef | grep...
Try :
psef=`ps -ef | grep IP-PoolSession-Summary.sh | grep -v grep | wc -l`
if [ $psef -ge 1 ];
then
echo
echo -e "\033[41;37mSorry! Another user is currently running the script. Please...
6,228
Posted By aigles
You can do something like that : awk 'NR>=From...
You can do something like that :
awk 'NR>=From {print; if (/@/) exit }' From=3 inputfile

Jean-Pierre.
2,024
Posted By aigles
Try /usr/xpg4/bin/awk instead of nawk ...
Try /usr/xpg4/bin/awk instead of nawk

Jean-Pierre.
1,336
Posted By aigles
You can also use cut : cut -f2 -d, file ...
You can also use cut :
cut -f2 -d, file

Jean-Pierre.
2,373
Posted By aigles
Sorry, I still do not understand your request. ...
Sorry, I still do not understand your request.
In your example, the column TGT_COL3 not seem to be an average but rather a sum.

Can you explain in details how you get your output.

Jean-Pierre.
1,151
Posted By aigles
echo 'Sau(rabh is Nice' | nawk -v a="Saurabh"...
echo 'Sau(rabh is Nice' | nawk -v a="Saurabh" '{print substr($1,1,match($1, /[(]/))}'

Jean-Pierre.
2,373
Posted By aigles
Within your sample result, COL3 is not the...
Within your sample result, COL3 is not the average on col4 based on col2 but the sum of col4 based on col1.

From your requirement, I don't understand how you can mix in the same output value of...
1,228
Posted By aigles
Only GNU version of grep supports the -A option. ...
Only GNU version of grep supports the -A option.

You can do something like that :
awk '
NR==FNR { pattern[">" $1] ; next }
$1 in pattern { print; print_next=1; next }
print_next--...
21,356
Posted By aigles
Another way : set -- ${a } if [ $# -eq 0 ] ;...
Another way :
set -- ${a }
if [ $# -eq 0 ] ; then
echo empty
fi

Jean-Pierre.
4,845
Posted By aigles
Use $* instead of $@ : a="a b c" set -- $a ...
Use $* instead of $@ :
a="a b c"
set -- $a
if [ "$*" = "" ] ; then
echo empty
fi

Jean-Pierre.
2,484
Posted By aigles
A solution with awk : awk ' $4 !~ /&/ { ...
A solution with awk :
awk '
$4 !~ /&/ {
print;
next;
}
{
out = $1 OFS $2 OFS $3;
kvc = split($4, kv, /&/);
for (i=2; i<=kvc; i++) {
v = kv[i];
...
3,454
Posted By aigles
First, there are missing $ in your script : if...
First, there are missing $ in your script :
if [ "$varSSCode" == "11" -o "$varSSCode" == "56" -o "$varSSCode" == "93" ]; then


A possible solution (using a list of values, not an array)...
2,768
Posted By aigles
Something like that : awk...
Something like that :
awk 'NR==FNR{x[$0];next}{for(r in x) r=r+".*" gsub(r, "",$2)}1' patternlist infile

Jean-Pierre.
19,378
Posted By aigles
bash specific ! doesn't work whith ksh ...
bash specific ! doesn't work whith ksh

Jean-Pierre.
24,539
Posted By aigles
How to recognize the lines that were splitted ? ...
How to recognize the lines that were splitted ?

Jean-Pierre.
5,494
Posted By aigles
Another way : Last=0 while : do ...
Another way :
Last=0
while :
do
Line=$(wc -l < moo.txt)
awk "NR>$Last {p=1}p" moo.txt #pipe this to log analyzer program
Last=$Line
sleep 10
done


Jean-Pierre.
3,336
Posted By aigles
Replace space before awk : #!/bin/ksh ...
Replace space before awk :
#!/bin/ksh
filesrc=/usr/kk/Source1.txt
filetgt=/usr/kk/Source2.txt

FINAL_COUNTS=`awk '{n++} END {printf "%012d\n",n}' ${filesrc} ${filetgt}`
 
echo 'Final Count...
956
Posted By aigles
ONCALL_NUMBER=`$SCRIPT/smsnumber` ...
ONCALL_NUMBER=`$SCRIPT/smsnumber`
$SCRIPT/sendsms "TO:$ONCALL_NUMBER@sms.info.com%FROM:Ateam@info.com%SUBJECT:<The Box is knackered again>"

Jean-Pierre.
2,777
Posted By aigles
add "set -x" for debuging purposes : ...
add "set -x" for debuging purposes :
#!/bin/bash
set -x

Jean-Pierre.
2,976
Posted By aigles
while true do a=`wc -l <abc` b=`wc...
while true
do
a=`wc -l <abc`
b=`wc -l <def`

if [ $a == $b ]
then
echo "a"
break
else
echo "b"
break
fi
sleep 5 # Sleep for 5...
2,777
Posted By aigles
echo -e " \n You want only Projects branched out...
echo -e " \n You want only Projects branched out to $var3 OR the whole branch merge \n "
read var4

if [ "$var4" == "$var3" ] ; then
if [ "$var1" = dryrun ] ; then
sed -n '/$var3/p'...
8,455
Posted By aigles
With this syntax, the marker must be preceded by...
With this syntax, the marker must be preceded by a tabulation !

Jean-Pierre.
12,658
Posted By aigles
program=$(whence $0) program_dir=$(cd $(dirname...
program=$(whence $0)
program_dir=$(cd $(dirname $program);pwd)

Jean-Pierre.
17,242
Posted By aigles
awk ' BEGIN { FS="[<>]"; OFS="," } ...
awk '
BEGIN { FS="[<>]"; OFS="," }
/name=/ { sub(/.*="/, "", $2); Name = substr($2, 1, length($2)-1); next }
$2=="ticketingEvent" { print Name,$3; next }
' inputfile


Jean-Pierre.
Showing results 1 to 25 of 500

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