Difference between revisions of "User talk:Grufo"

From ArchWiki
Jump to: navigation, search
(pacman tips "edit war")
 
(Colors for "command not found")
(6 intermediate revisions by 2 users not shown)
Line 5: Line 5:
  
 
-- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 19:24, 21 November 2012 (UTC)
 
-- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 19:24, 21 November 2012 (UTC)
 +
:@Karol
 +
:1. Because it doesn't work with newlines in an "alias" context. Try yourself!
 +
:2. I'm an "Archer" and know Bash, but I spent ten minutes to write that line. Do you think that a Wiki should tell everyone: «Ok, guy, find yourself the solution»?
 +
:--[[User:Grufo|Grufo]] <sup>[ [[Special:Contributions/Grufo|contribs]] | [[User_talk:Grufo|talk]] ]</sup> 19:39, 21 November 2012 (UTC)
 +
::1. Works here: {{bc|<nowiki>$ pacman -Qqdt
 +
firefox
 +
flashplugin
 +
$ pacro
 +
checking dependencies...
 +
 +
Targets (7):
 +
 +
Name            Old Version    New Version  Net Change
 +
 +
libevent        2.0.20-1                      -1,79 MiB
 +
libnotify      0.7.5-1                      -0,26 MiB
 +
mime-types      8-1                          -0,05 MiB
 +
mozilla-common  1.4-3                        -0,02 MiB
 +
nss            3.14-1                        -5,70 MiB
 +
firefox        16.0.2-1                    -21,52 MiB
 +
flashplugin    11.2.202.251-1              -20,83 MiB
 +
 +
Total Removed Size:    50,16 MiB
 +
 +
Do you want to remove these packages? [Y/n] n
 +
$ type pacro
 +
pacro is aliased to `/usr/bin/pacman -Qtdq > /dev/null && sudo /usr/bin/pacman -Rs $(/usr/bin/pacman -Qtdq)'</nowiki>}}
 +
::(I'm watching this page, so it's not necessary to edit my talk page to [https://wiki.archlinux.org/index.php?title=User_talk:Karol&diff=0&oldid=216338 notify my of your response], but thanks anyway) -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 20:21, 21 November 2012 (UTC)
 +
 +
:::Your solution with newlines doesn't work on my computer :-( It works fine only with spaces.
 +
:::I think that, since in a bash context a separator is a space and not a newline, an "universal" solution is to use spaces instead of newlines. But this is my opinion.--[[User:Grufo|Grufo]] <sup>[ [[Special:Contributions/Grufo|contribs]] | [[User_talk:Grufo|talk]] ]</sup> 20:30, 21 November 2012 (UTC)
 +
::::Do you get any errors when running {{ic|sudo pacman -Rs $(pacman -Qqdt)}} in the terminal? What's the output of {{ic|<nowiki>echo "$IFS" | cat -te</nowiki>}}? If you substitute the sed part with {{ic|tr '\n' ' '}}, does it still work for you? -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 21:09, 21 November 2012 (UTC)
 +
:::::@Karol
 +
:::::> Do you get any errors when running {{ic|sudo pacman -Rs $(pacman -Qqdt)}} in the terminal?
 +
:::::No, out of alias context {{ic|sudo pacman -Rs $(pacman -Qqdt)}} works
 +
:::::> What's the output of {{ic|<nowiki>echo "$IFS" | cat -te</nowiki>}}?
 +
:::::What is {{ic|$IFS}}?? However the output is:
 +
:::::{{bc|<nowiki>^I$
 +
$</nowiki>}}
 +
:::::> If you substitute the sed part with {{ic|tr '\n' ' '}}, does it still work for you?
 +
:::::Substituting the sed part with {{ic|tr '\n' ' '}} it works fine!
 +
:::::--[[User:Grufo|Grufo]] <sup>[ [[Special:Contributions/Grufo|contribs]] | [[User_talk:Grufo|talk]] ]</sup> 19:54, 22 November 2012 (UTC)
 +
::::::IFS is the internal field separator, the default is a space, tab or newline. Not sure if you copied it verbatim, but the space seems to be missing: {{bc|<nowiki>
 +
$ IFS=$' \t\n'
 +
$ echo "$IFS" | cat -te
 +
^I$
 +
$</nowiki>}}
 +
::::::That shouldn't matter though, as the problem is with the newlines and they're included in your IFS (it's the single '$' on the second line), as expected.
 +
::::::I'd like to sort this out, so please open a thread on the forums. Please provide sample output when using the alias.
 +
::::::Using either single quotes or double quotes and escaping the '$' in the alias both work fine here. -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 22:31, 22 November 2012 (UTC)
 +
 +
==Colors for "command not found"==
 +
Hi, I'd like to talk in [[Talk:Bash#Colors for "command not found"]] about [https://wiki.archlinux.org/index.php?title=Bash&diff=285981&oldid=285980]. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 03:00, 4 December 2013 (UTC)

Revision as of 03:00, 4 December 2013

pacman tips

1. Why do you think you need to change newlines to spaces?

2. I think that Archers are capable of creating trivial aliases and functions themselves.

-- Karol (talk) 19:24, 21 November 2012 (UTC)

@Karol
1. Because it doesn't work with newlines in an "alias" context. Try yourself!
2. I'm an "Archer" and know Bash, but I spent ten minutes to write that line. Do you think that a Wiki should tell everyone: «Ok, guy, find yourself the solution»?
--Grufo [ contribs | talk ] 19:39, 21 November 2012 (UTC)
1. Works here:
$ pacman -Qqdt
firefox
flashplugin
$ pacro
checking dependencies...

Targets (7):

Name            Old Version     New Version  Net Change

libevent        2.0.20-1                      -1,79 MiB
libnotify       0.7.5-1                       -0,26 MiB
mime-types      8-1                           -0,05 MiB
mozilla-common  1.4-3                         -0,02 MiB
nss             3.14-1                        -5,70 MiB
firefox         16.0.2-1                     -21,52 MiB
flashplugin     11.2.202.251-1               -20,83 MiB

Total Removed Size:     50,16 MiB

Do you want to remove these packages? [Y/n] n
$ type pacro
pacro is aliased to `/usr/bin/pacman -Qtdq > /dev/null && sudo /usr/bin/pacman -Rs $(/usr/bin/pacman -Qtdq)'
(I'm watching this page, so it's not necessary to edit my talk page to notify my of your response, but thanks anyway) -- Karol (talk) 20:21, 21 November 2012 (UTC)
Your solution with newlines doesn't work on my computer :-( It works fine only with spaces.
I think that, since in a bash context a separator is a space and not a newline, an "universal" solution is to use spaces instead of newlines. But this is my opinion.--Grufo [ contribs | talk ] 20:30, 21 November 2012 (UTC)
Do you get any errors when running sudo pacman -Rs $(pacman -Qqdt) in the terminal? What's the output of echo "$IFS" | cat -te? If you substitute the sed part with tr '\n' ' ', does it still work for you? -- Karol (talk) 21:09, 21 November 2012 (UTC)
@Karol
> Do you get any errors when running sudo pacman -Rs $(pacman -Qqdt) in the terminal?
No, out of alias context sudo pacman -Rs $(pacman -Qqdt) works
> What's the output of echo "$IFS" | cat -te?
What is $IFS?? However the output is:
^I$
$
> If you substitute the sed part with tr '\n' ' ', does it still work for you?
Substituting the sed part with tr '\n' ' ' it works fine!
--Grufo [ contribs | talk ] 19:54, 22 November 2012 (UTC)
IFS is the internal field separator, the default is a space, tab or newline. Not sure if you copied it verbatim, but the space seems to be missing:
$ IFS=$' \t\n'
$ echo "$IFS" | cat -te
 ^I$
$
That shouldn't matter though, as the problem is with the newlines and they're included in your IFS (it's the single '$' on the second line), as expected.
I'd like to sort this out, so please open a thread on the forums. Please provide sample output when using the alias.
Using either single quotes or double quotes and escaping the '$' in the alias both work fine here. -- Karol (talk) 22:31, 22 November 2012 (UTC)

Colors for "command not found"

Hi, I'd like to talk in Talk:Bash#Colors for "command not found" about [1]. -- Kynikos (talk) 03:00, 4 December 2013 (UTC)