Search Results

Search: Posts Made By: aigles
1,480
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,858
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,343
Posted By aigles
Try /usr/xpg4/bin/awk instead of nawk ...
Try /usr/xpg4/bin/awk instead of nawk

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

Jean-Pierre.
1,222
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.
774
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,222
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...
906
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,657
Posted By aigles
Another way : set -- ${a } if [ $# -eq 0 ] ;...
Another way :
set -- ${a }
if [ $# -eq 0 ] ; then
echo empty
fi

Jean-Pierre.
3,978
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,974
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,827
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,151
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,406
Posted By aigles
bash specific ! doesn't work whith ksh ...
bash specific ! doesn't work whith ksh

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

Jean-Pierre.
4,505
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.
888
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...
626
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,955
Posted By aigles
add "set -x" for debuging purposes : ...
add "set -x" for debuging purposes :
#!/bin/bash
set -x

Jean-Pierre.
2,158
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,955
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,779
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,421
Posted By aigles
program=$(whence $0) program_dir=$(cd $(dirname...
program=$(whence $0)
program_dir=$(cd $(dirname $program);pwd)

Jean-Pierre.
14,766
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,045
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 11:11 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy