Linux Support 802.1Ag and Y1731

Extract previous value by group from other group column

One option is to create a row number column on DF, then use data.table rolling join:

library(data.table)
setDT(DF)[, rn := seq_len(.N)]

DF[DF,
on=.(ID_2 = ID_1, rn = rn),
.(ID_1 = i.ID_1, ID_2 = i.ID_2, Value = i.Value, New = x.Value),
roll=Inf
]

# ID_1 ID_2 Value New
# 1: A G 10 NA
# 2: B D 9 NA
# 3: C I 15 NA
# 4: D A 27 9
# 5: A J 3 27
# 6: A B 28 27
# 7: B K 4 28
# 8: E D 3 NA
# 9: D A 11 3
#10: F H 19 NA
#11: H A 12 19

Unable to append group to user gropus with usermod

Your '-' character is incorrect. Maybe you've copy and paste it from somewhere or you're using a non-standard keyboard.
Take a look at your command hex-dump:

echo 'usermod –a –G support user1' | hd
00000000 75 73 65 72 6d 6f 64 20 e2 80 93 61 20 e2 80 93 |usermod ...a ...|
00000010 47 20 73 75 70 70 6f 72 74 20 75 73 65 72 31 0a |G support user1.|
00000020

But the correct one is:

echo 'usermod -a -G support user1' | hd
00000000 75 73 65 72 6d 6f 64 20 2d 61 20 2d 47 20 73 75 |usermod -a -G su|
00000010 70 70 6f 72 74 20 75 73 65 72 31 0a |pport user1.|
0000001c

Notice the - character in the second hex and compare it with your



Related Topics



Leave a reply



Submit