!yzBwvLxciGLIBHonQe:matrix.org

bash

91 Members
Discussions about Bash shell, scripting, etc.28 Servers

Load older messages


SenderMessageTime
15 Jun 2020
@nicoty:matrix.orgnicoty I think so. At least that's what the second and first calls to printf seems to indicate 18:23:02
@nicoty:matrix.orgnicotyI even copy and pasted the outputs from my terminal to a text editor to see if there were any leading spaces or anything, but that doesn't seems to be the case, so I'm genuinely befuddled as to why it doesn't work 😐️18:24:36
@gate32:matrix.orggate32I checked it again, but it looks like it should be working18:31:27
@nicoty:matrix.orgnicoty
In reply to@bullshark_:matrix.org

How can I get the user for uid 1000 in a script? This is outputting more than just the user.

$id 1000
uid=1000(bullshark) gid=1000(bullshark) groups=1000(bullshark),998(wheel),991(lp),3(sys),90(network),98(power)
Hmm I think you can probably use parameter expansion for that https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_02. You'd need to use it twice, once to remove the first ( and everrthing before it, and then again to remove the first ) and everything after it which should leeve you with just the username.
23:00:32
@nicoty:matrix.orgnicoty Or apparently this would work as well: getent passwd "$uid" | cut -d: -f1 23:00:33
@nicoty:matrix.orgnicotyOh never mind. Looks like you already figured out a solution lol23:00:39
16 Jun 2020
@bullshark_:matrix.orgbullsharkI have $1 and $3 in single quotes, but they are still being interpreted as function arguments instead of part of awk. http://vpaste.net/kV7VI20:45:01
@bullshark_:matrix.orgbullsharkFixed21:12:07
18 Jun 2020
@christian:cybre.spacechristian joined the room.22:51:01
19 Jun 2020
@joey:perthchat.orgjoey joined the room.18:27:14
@jannis:asra.grjannis 19:13:28
@joey:perthchat.orgjoey 22:10:59
20 Jun 2020
@otto:feneas.orgotto 16:25:54
22 Jun 2020
@ljudmila:sibnsk.netljudmila 08:20:03
23 Jun 2020
@elena:ru-matrix.orgelena 19:04:29
24 Jun 2020
@lara:ggc-project.delara 22:59:08
25 Jun 2020
@karin:kde.orgkarin 21:12:32
@mike:nerdsin.spacemike 22:17:25
1 Jul 2020
@mrquack:matrix.orgMr. Quack joined the room.12:05:44
@mrquack:matrix.orgMr. QuackAny sed expert?12:05:51
@mrquack:matrix.orgMr. QuackI'm trying to update a string that contains some special characters and it's driving me crazy12:06:58
4 Jul 2020
@kalidas:diasp.inkalidas 18:18:42
7 Jul 2020
@sienna249:matrix.org@sienna249:matrix.org joined the room.17:11:26
8 Jul 2020
@sienna249:matrix.org@sienna249:matrix.org left the room.00:40:30
@n0q:matrix.orgn0q joined the room.06:26:56
@n0q:matrix.orgn0q set a profile picture.06:30:51
@stefan:matrix.allmende.iostefan 19:13:41
@peter:tomesh.netpeter 19:23:53
10 Jul 2020
@jon:converser.eujon 21:38:25
14 Jul 2020
@doc_gonzo:matrix.orgdoc_gonzo joined the room.01:19:30

There are no newer messages yet.


Back to Room List