Visit The New, Modern Unix Linux Community

Search Results

Search: Posts Made By: aigles
1,711
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"],
...
54,307
Posted By aigles
You can use awk to format the size field : du...
You can use awk to format the size field :
du -k | sort -nr | awk '
BEGIN {
split("KB,MB,GB,TB", Units, ",");
}
{
u = 1;
while ($1 >= 1024) {
...
50,104
Posted By aigles
Another way : echo 'd *' | mail -N ...
Another way :
echo 'd *' | mail -N


Jean-Pierre.
919
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--...
2,865
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)...
4,616
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.
929
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...
682
Posted By aigles
cmp -l lewis_1.txt lewis_2.txt | awk -v Q="'" '...
cmp -l lewis_1.txt lewis_2.txt |
awk -v Q="'" '
function oct2dec(o ,i,d){
for(i=1;i<=length(o);++i){
d=(8*d)+substr(o,i,1);
}
return d
}
{
offset = $1 - 1;
old =...
682
Posted By aigles
You can do something like that : $ cat...
You can do something like that :
$ cat lewis.ksh
cmp -l lewis_1.txt lewis_2.txt |
awk -v Q="'" '
function oct2dec(o ,i,d){
for(i=1;i<=length(o);++i){
d=(8*d)+substr(o,i,1);
}
...
5,092
Posted By aigles
From gawk documentation : Try : awk '{...
From gawk documentation :

Try :
awk '{ if($0 ~ /^http:\/\/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]{1,3}\.[0-9]\{1,3\}(:[0-9]\{1,5\})?/) print $0}' f7


I test the original awk command with some...
1,679
Posted By aigles
Another way : $ result=val1,val2 $...
Another way :
$ result=val1,val2
$ v1=${result%%,*}
$ v2=${result##$v1,}
$ echo $v1
val1
$ echo $v2
val2
$


Jean-Pierre.
798
Posted By aigles
You can do something like that : awk ' { ...
You can do something like that :
awk '
{
Times[$5,++Job[$5]] = $2;
}
END {
for (j in Job) {
printf "%-8s : %s\n", j, (Job[j] >= 4 ?...
848
Posted By aigles
Try and adapt the following awk script that makes...
Try and adapt the following awk script that makes all the work (I hope) :
awk -v FS='[][()]' '

FNR==1 {
printLookup();
FileName = FILENAME;
}

/CMN_1716 Lookup/ {...
3,464
Posted By aigles
Try and adapt this awk script : awk -v FS='|'...
Try and adapt this awk script :
awk -v FS='|' -v OFS='|' '
{
if (MaxFields < NF) MaxFields = NF;
for (i=1; i<=NF; i++) {
Field[NR, i] = $i;
l =...
9,265
Posted By aigles
Try :find $fpath \( -newer /tmp/newerstart -a \!...
Try :find $fpath \( -newer /tmp/newerstart -a \! -newer /tmp/newerend \) | xargs gzip

Jean-Pierre.
3,781
Posted By aigles
#!/bin/ksh PROG=$0;export PROG ...
#!/bin/ksh
PROG=$0;export PROG
PATH=/usr/informent/dv03/bin:$PATH;export PATH
ORAUSER=`get_inf_env INFORM_DB_ACCOUNT`;export ORAUSER
BATCH_HOME=`get_inf_env INFORM_DATA_HOME`


Jean-Pierre.
1,526
Posted By aigles
Try: value=2 sed...
Try: value=2
sed "s!\(<num_clusters>\)[0-9]*\(</num_clusters>\)!\1${value}\2!" 1_cluster_TTP.dat.xml

Jean-Pierre.
635
Posted By aigles
Another way with ksh or bash (with extglog option...
Another way with ksh or bash (with extglog option set) :
if [[ "${a}" == @(one|two) ]]

Jean-Pierre.
639
Posted By aigles
Try: sed...
Try:
sed "s/$title:$author:$price:$qtyAvailable:$qtySold/$Ntitle:$author:$price:$qtyAvailable:$qtySold/"

Jean-Pierre.
1,249
Posted By aigles
From crontab you can do : minute hour...
From crontab you can do :
minute hour day_of_month month day_of_week your_script.sh%1%yes%n%64

Jean-Pierre.
1,143
Posted By aigles
One way:var=9235793579usa9485 if [[ "$var" =...
One way:var=9235793579usa9485
if [[ "$var" = *[a-zA-Z]* ]]
then
print "String contains alphabetic characters"
else
print "No alphabetic character."
fi


Jean-Pierre.
6,685
Posted By aigles
1) Add -v options nawk -v FD="$F_D" -v SS="$S_S"...
1) Add -v options nawk -v FD="$F_D" -v SS="$S_S" -v DS="$D_S" 'BEGIN {FS=","} {printf("%-1s%-4s%-30s","0",$2,FD,SS,DS)}'

2) Remove loop (cat,grep while read) :nawk -v FD="$F_D" -v SS="$S_S" -v...
5,902
Posted By aigles
Merge the two tr statement into one : echo...
Merge the two tr statement into one :
echo "$string1 $string2" | tr ' |' '\n\n'

Jean-Pierre.
5,902
Posted By aigles
a pure shell (ksh) solution :#!/usr/bin/ksh ...
a pure shell (ksh) solution :#!/usr/bin/ksh

string1='abc|def|hij'
string2='12|13|14'
string3=''

oIFS="${IFS}"
IFS='|'

set -A str1 ${string1}
set -A str2 ${string2}

IFS="${oIFS}"
...
889
Posted By aigles
You can do something like that : $ cat...
You can do something like that :
$ cat aswex.ksh

FileList=./aswex.dat
LastFile=./aswex.dat.last

touch ${LastFile}
(( last = $(<${LastFile}) + 0 ))

print "Starting from line $((last+1))"...
Showing results 1 to 25 of 58

 

Featured Tech Videos

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