!MiPOrXJIJudCrKmvfO:matrix.org

general

226 Members
11 Servers

Load older messages


SenderMessageTime
6 Jan 2024
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 that's valid bash 18:06:25
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 and any loop, conditional, or grouping commands are valid for that ending 18:07:59
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 the most common is that last one which the most common of that is {} 18:08:13
@_discord_1174247883814486048:t2bot.iovigress7 So why does this result in no output? How does inheritance work here
function bar() {
  export foo=5
}

function baz() {
  echo $foo
}

baz
18:11:17
@_discord_1174247883814486048:t2bot.iovigress7 Oh sorry 18:11:27
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 you never call bar 18:11:31
@_discord_1174247883814486048:t2bot.iovigress7 Yes brainfart 18:11:37
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 if you did:
bar
baz
18:11:49
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 it would work 18:11:50
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 or hell even if you didn't have export in front 18:12:07
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 the only reason to use export is to make it available to sub-processes 18:12:30
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432
function bar() {
  export foo=5
}

function baz() (
  echo $foo
)

bar
baz
18:12:59
@_discord_1174247883814486048:t2bot.iovigress7 Then why, when I edit the pacscript to export mod_dir in package(), does post_install() not inherit mod_dir? 18:13:02
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 that would workj 18:13:03
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 * that would work 18:13:05
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 hm 18:14:49
@_discord_1174247883814486048:t2bot.iovigress7
~> ll /usr/bin/prettier
lrwxrwxrwx 1 root root 18 Jan  6 21:58 /usr/bin/prettier -> //bin/prettier.cjs
18:15:11
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 OH 18:15:35
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 I know why 18:15:40
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 ok so how we handle postscripts is like this: 18:15:59
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432
<pacscript pasted here>

<postscript function call here>
18:16:17
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 even though it's "exported", this is a new run of the script so it won't call it 18:16:32
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 like this 18:16:39
@_discord_1174247883814486048:t2bot.iovigress7 I'll define it outside of the functions then 18:17:23
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 yeah that would work 18:17:28
@_discord_1174247883814486048:t2bot.iovigress7 Aight, it works 18:25:20
@_discord_1174247883814486048:t2bot.iovigress7 Thanks for the lecture, that filled in some gaps in my knowledge 18:26:11
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 yeah most of the time you'll use:

foo() {}
local foo=bar
18:36:34
7 Jan 2024
@_discord_788875075847454742:t2bot.ioTwilightBlood#4432 godbolt.org 02:51:06
@_discord_723508718381039636:t2bot.ioalwindoss How do you generate this? 02:51:08

Show newer messages


Back to Room ListRoom Version: 6