You are not logged in.
Pages: 1
hello bbs
i want to send a patch for /etc/profile
i want to replace these six lines
# Append our default paths
appendpath () {
case ":$PATH:" in
*:"$1":*)
;;
*)
PATH="${PATH:+$PATH:}$1"
esac
}with this one line
# Append our default paths
appendpath () {
[[ ":$PATH:" != *":$1:"* ]] && PATH="${PATH:+$PATH:}$1"
}now ....
$ pacman -Qo /etc/profile
/etc/profile is owned by filesystem 2020.05.07-1
$ pacman -Qi filesystem | grep http
URL : https://www.archlinux.orgquestions
1. where is the source code of package filesystem?
2. where do i send the patch?
Offline
Why should this patch be accepted? What's the inherent advantage of it?
Your function produces a failing return code, by the way. It is also invalid syntax for various /bin/sh shells that don't implement [[
/etc/profile is NOT bash.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
That’s a bashism, it looks like that because it’s (and must be) POSIX...
Edit: argh @eschwartz beated me
Last edited by GaKu999 (2020-10-07 08:02:47)
Offline
1. where is the source code of package filesystem?
https://git.archlinux.org/svntogit/pack … nk/profile
2. where do i send the patch?
Others have already explained why a patch for this is *extremely* unlikely to be accepted, and you've not explained why it should either.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
It is also invalid syntax for various /bin/sh shells that don't implement [[
/etc/profile is NOT bash.
that is a killer argument : /
it looks like that because it’s (and must be) POSIX...
thanks for answering my hidden question
Last edited by milaxnuts (2020-10-07 19:05:33)
Offline
lets just ask some shells, how they like my pretty code
#!/bin/bash
s=$(cat <<'EOF'
#!/bin/sh
[[ 1 == 1 ]] && echo y
EOF
)
bash -c "$s"
# -> y
dash -c "$s"
# -> dash: 2: [[: not found
# rc = 127
posh -c "$s"
# -> posh: [[: not found
# rc = 127ash and mrsh will probably give the same answer
shellcheck.net says: SC3010: In POSIX sh, [[ ]] is undefined.
related: How can I test for POSIX compliance of shell scripts?
Offline
Pages: 1