Search Results

Search: Posts Made By: SkySmart
833
Posted By disedorgue
Hi, Maybe something like as : awk...
Hi,

Maybe something like as :
awk -vArgz="$ArgZ" -vArgZB="$ArgZB" 'BEGIN{split(Argz,A,"\n")}
FNR == 1 {Line=0}
FNR == 1 && $0 ~ /^#!/ {Line=FNR}
$0 == A[2] || $0 == A[3]{next}
/^import/...
1,157
Posted By murugesandins
You can use /bin/egrep or /bin/grep -E $...
You can use /bin/egrep or /bin/grep -E

$ /bin/egrep "19\/Jun\/2018:07:04|21\/Jun\/2018:21:30" datafile | /bin/egrep -v "^$"
41.27.21.19 - - [19/Jun/2018:07:04:28 +0000]
41.27.21.19 - -...
1,157
Posted By Chubler_XL
Perhaps a function like this will help you: ...
Perhaps a function like this will help you:

awk '
function toYMD(tm) {
split(tm, vals, "[/:]");
vals[2] = (index("JanFebMarAprMayJunJulAugSepOctNovDec", vals[2]) - 1) / 3 + 1
return...
1,302
Posted By wisecracker
Hi skysmart... I have no idea what you are...
Hi skysmart...

I have no idea what you are trying to do but your function is not called.
I guess you are trying to put that function in the interpreter namespace for other uses.

The function...
1,276
Posted By RudiC
As the sample doesn't contain the "WrongValue"...
As the sample doesn't contain the "WrongValue" string, you don't seem to want that condition tested.

Would this come close to what you need?
printf '%s\n' "${RawContent}" |
awk '
/## ...
1,176
Posted By RudiC
Would sth. like lsof -p$$ | awk '/ 1u/ {print...
Would sth. like
lsof -p$$ | awk '/ 1u/ {print $9}'
/dev/pts/2
or
ps | awk -vSELF=$$ 'match ($4, SELF) {print $13}'
pts/2help?
1,176
Posted By RudiC
tee to terminal might not be the solution as s/he...
tee to terminal might not be the solution as s/he wants "it stored in the bona variable with nothing outputted to the screen".

What does "i get the result "hi2" outside of the variable" mean?
866
Posted By Don Cragun
Expanding a little on what Corona688 has already...
Expanding a little on what Corona688 has already said, the who utility uses its standard input file descriptor to determine the terminal being used as your controlling terminal. If your script is...
866
Posted By Corona688
Without a terminal you don't get the usual...
Without a terminal you don't get the usual terminal control niceties. It does work, you just don't see it. Try redirecting the result into a file.
1,117
Posted By MadeInGermany
post#4 is unprecise (like post#1), for example...
post#4 is unprecise (like post#1), for example will find pid 22 when searching for 2.
While the overall sense is not clear for me, this is certainly *not* intended.
Fix:
ps -ef | awk...
1,117
Posted By apmcd47
So it looks to me that you are trying to list all...
So it looks to me that you are trying to list all the processes with the PID or PPID of "${gpid}"

Consider this:
ps --ppid "${gpid}" -opid=
This will list the PIDs of all processes whose PPID is...
1,117
Posted By RudiC
After sorting out some lome logical errors(e.g....
After sorting out some lome logical errors(e.g. the allpids matching), I guess you want a listing of the gpid process and its subprocesses. Try
ps -ef | awk -vGPID="$gpid" '$2 " " $3 ~ GPID'
1,117
Posted By Don Cragun
Maybe something like this would work: ps -ef |...
Maybe something like this would work:
ps -ef | awk -v gpid="$gpid" '
{ line[NR] = $0
pid[NR] = $2
ppid[NR] = $3
}
$2 == gpid || $3 == gpid {
PrintPid[$2]
PrintPid[$3]
}
END { for(i = 1;...
1,235
Posted By bakunin
It is a good idea to avoid external utilities...
It is a good idea to avoid external utilities when possible, but that doesn't mean you should never use them. In fact they are quite good at what they are supposed to do and as long as you do not...
1,041
Posted By rovf
Since you are mentioning cksum, I assume that you...
Since you are mentioning cksum, I assume that you mean the CRC checksum.

Look at this article for a Pure-Perl implementation:

Perl-only CRC32 function (without C code)...
1,350
Posted By apmcd47
You can also remove the filename from the output...
You can also remove the filename from the output of cksum:
$ cksum file
812788392 1423 file
$ cksum < file
812788392 1423

Obviously you cannot do this if getting the checksum of multiple...
1,350
Posted By Scrutinizer
If you are using bash, ksh93 or zsh, you could do...
If you are using bash, ksh93 or zsh, you could do something like this
read v1 v2 dummy < <(cksum sjreas.py)

---
The reason you get a trailing space in your variable may also be because of the...
1,350
Posted By jim mcnamara
Since you call the external cksum command, I do...
Since you call the external cksum command, I do not see the value of losing the call to awk ... unless you have this code execute hundreds of times in a loop we did not see.


while read v1 v2 v3 ...
1,315
Posted By Scott
Well, AIX uses Ksh, not SH, but you can always...
Well, AIX uses Ksh, not SH, but you can always trust Solaris to have some dilapidated default junk right out of the box ;) although if you have the option of /usr/xpg4/bin/sh, as Don mentions, that's...
1,315
Posted By Don Cragun
If the data is in a variable as in: ...
If the data is in a variable as in:
var=bblah1_blah2_blah3_blah4_blah5
you can get the last field with:
last=${var##*_}
and the next to the last field with:
tmp=${var%_*}
second_last=${tmp##*_}...
1,315
Posted By Scott
If you change the read to read into an array, you...
If you change the read to read into an array, you can access each member of the array by index.
e.g.

unset line
while IFS=_ read -A line; do
NF=$((${#line[@]}-1))
echo ${line[(($NF))]} #...
994
Posted By RudiC
Just for the fun of it - as the original spec for...
Just for the fun of it - as the original spec for me is unintelligible - this would yield the same, incomprehensible result:
awk '{$0 = substr ($0,1,400); TNF += NF; TC += length} NR==4 {exit} END...
1,375
Posted By Scrutinizer
Try: echo...
Try:
echo "'/var/FTPROOT/px/sci/archive/20171102070057904-DY_DC04_Daily Inventory Sync-en-us.csv' '/var/FTPROOT/px/sci/archive/20171102070058291-DY_DC07_Daily Inventory Sync-en-us.csv'" |
awk...
1,375
Posted By RavinderSingh13
Hello SkySmart, Could you please try...
Hello SkySmart,

Could you please try following and let me know if this helps.(test with only provided sample).

echo '/var/FTPROOT/px/sci/archive/20171102070057904-DY_DC04_Daily Inventory...
1,161
Posted By Yoda
You can also try running gdb in non-interactive...
You can also try running gdb in non-interactive mode and get the flag variable value:-
gdb -q /bin/bash -ex "print echo_command_at_execute" -ex quit
Showing results 1 to 25 of 500

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