Search Results

Search: Posts Made By: port43
1,394
Posted By Scrutinizer
Alternative approaches you could try: awk ' ...
Alternative approaches you could try:
awk '
{
for(i=9; i<=NF; i++)
if($i=="BUNDLE-GIM" && $(i+2)~/r100595/)
print $3, $i, $(i+2)
}
' RS=\< file

awk '/<api/{s=$NF}...
1,394
Posted By RudiC
Try awk '{if (/clientIP/)(SRV = $NF); if ($2 ~...
Try
awk '{if (/clientIP/)(SRV = $NF); if ($2 ~ /BUNDLE-GIM/) {getline; G=1}; if (G && $2 ~ /r100595/) print SRV,"BUNDLE-GIM",$2; G=0}' file
clientIP=srv1002 BUNDLE-GIM 10.1.2_r100595_1
EDIT: or,...
2,182
Posted By bakunin
Furthermore there is an additional problem:...
Furthermore there is an additional problem: depending on the LV you may need more than one PP to increase the LV by 1 LP. These PPs may (depending on the setting of the "strictness" property) have to...
2,182
Posted By Chubler_XL
As others have stated the while loop is run in a...
As others have stated the while loop is run in a subshell and variable assignments are lost the general accepted solution is to use Process Substitution eg:


while read VGNAME
do
...
2,182
Posted By MadeInGermany
Because the while block is fed by a pipe, it is...
Because the while block is fed by a pipe, it is run in a sub shell.
The sub shell inherits (gets copied) variables from the main shell, but not vice versa.
Only the ksh (and true derivatives- not...
2,182
Posted By Corona688
echo asdf | read X is a KSH habit that's...
echo asdf | read X is a KSH habit that's unportable to other Bourne shells. Anything but KSH will set X in a subshell, where you'll never see it.

Some versions of BASH have a way to override this...
2,771
Posted By vgersh99
you're reading the file content AND prompting...
you're reading the file content AND prompting from the same 'stream' - stdin.
You need to split that into 2 streams:

#!/bin/ksh

exec 3< singlecolumnfile.txt

while read -u3 SRV
....
done
1,400
Posted By Scott
If I had to guess what you're doing wrong, it...
If I had to guess what you're doing wrong, it would be that you're not listening.
1,696
Posted By Scrutinizer
@LeftoverStew, tt is a bit more complicated than...
@LeftoverStew, tt is a bit more complicated than that. A link in the same directory, means making the link to the file name only (without the path). Also, there are all sorts of error condition that...
Forum: HP-UX 03-06-2014
2,533
Posted By Perderabo
Yeah, the fact that @ is acting as a line kill...
Yeah, the fact that @ is acting as a line kill character does indeed cause problems with passwords containing a @ character. You can't reset your kill character until after you login and run an...
12,776
Posted By Yoda
An awk approach: awk -F'\t' ' { ...
An awk approach:
awk -F'\t' '
{
TP += ( $2 == 1 && $3 == 1 ) ? 1 : 0
TN += ( $2 == 0 && $3 == 0 ) ? 1 : 0
FP += ( $2 == 1 && $3 == 0 ) ? 1...
7,332
Posted By Corona688
It is because of ssh. It tries to read input...
It is because of ssh. It tries to read input from standard input -- which happens to be "${SRV}_passwd.txt" in this case, eating all your input in one go and breaking the loop.

To make it not do...
6,224
Posted By MadeInGermany
A clumsy method is to replace the ' by '\'' and...
A clumsy method is to replace the ' by '\'' and put the remote command in ' '.
ssh <host> 'awk -F: '\''$3 == 64600 {print $1}'\'' /etc/group'The better method:
put the normal command in a script...
1,658
Posted By Don Cragun
As Corona688 already said, the order in which rm...
As Corona688 already said, the order in which rm processes files found in a directory is unspecified. All implementations of rm that I've seen will process them in the order that you would see if...
1,658
Posted By Corona688
find finds things in arbitrary order, just the...
find finds things in arbitrary order, just the order they're stored in the directory entries on disk -- which is completely arbitrary. It's very difficult to say where this command started.
3,005
Posted By Franklin52
Try this: awk -v var="SecRoot" ' ...
Try this:
awk -v var="SecRoot" '
NR==1{s=$0;r="image=/" tolower(var);next}
$0 ~ var{sub("image=",r,s)}
{print s; s=$0}
END{print s}' file
2,902
Posted By era
Or even just run the command once. perms=`ls...
Or even just run the command once.

perms=`ls -l "$1" | cut -f1`
case $perms in
?r?????????) echo Read for owner;;
esac
case $perms in
??w???????) echo Write for owner;;
esac

etcetera. ...
Showing results 1 to 17 of 17

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