Search Results

Search: Posts Made By: aigles
1,461
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...
3,790
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.
1,316
Posted By aigles
Try /usr/xpg4/bin/awk instead of nawk ...
Try /usr/xpg4/bin/awk instead of nawk

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

Jean-Pierre.
1,168
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.
769
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.
1,168
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...
896
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--...
16,338
Posted By aigles
Another way : set -- ${a } if [ $# -eq 0 ] ;...
Another way :
set -- ${a }
if [ $# -eq 0 ] ; then
echo empty
fi

Jean-Pierre.
3,944
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.
1,950
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];
...
2,795
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,125
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.
13,170
Posted By aigles
bash specific ! doesn't work whith ksh ...
bash specific ! doesn't work whith ksh

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

Jean-Pierre.
4,468
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.
874
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...
621
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.
1,933
Posted By aigles
add "set -x" for debuging purposes : ...
add "set -x" for debuging purposes :
#!/bin/bash
set -x

Jean-Pierre.
2,134
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...
1,933
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'...
6,728
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.
9,281
Posted By aigles
program=$(whence $0) program_dir=$(cd $(dirname...
program=$(whence $0)
program_dir=$(cd $(dirname $program);pwd)

Jean-Pierre.
14,610
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.
1,032
Posted By aigles
Works also on KSH. Jean-Pierre.
Works also on KSH.

Jean-Pierre.
Showing results 1 to 25 of 500

 

Featured Tech Videos

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