21,515 reputation
34778
bio website
location United States
age
visits member for 3 years, 7 months
seen 18 hours ago

Debian user, GNU/Linux enthusiast, FLOSS supporter, hobby developer.


Nov
13
comment tmux vim colorscheme background is not showing
In my experience, tmux behaves strangely when launched inside gnome-terminal. Try launching tmux with TERM=xterm tmux and see if it behaves differently. If xterm doesn't work, try xterm-256color or xterm-color.
Nov
13
comment what is the difference between `find .` and /home/user/* as an input to for command
@edwardtorvalds For the problem pointed out by the Wheeler link, use ./* and the problem is solved. The wheeler link is irrelevant to your first comment about abc def.txt though. I still do not know what you were trying to say with your comment about abc def.txt.
Nov
13
comment what is the difference between `find .` and /home/user/* as an input to for command
@edwardtorvalds Can you provide more information? * should match a file named abc def.txt. If it doesn't something is wrong so tell exactly what you type and exactly what output you get.
Nov
13
comment Autostarting Conky Weird Behaviour
It sounds like conky is running in the foreground. Try killing everything conky related and running it from a terminal, to see if it returns you to your prompt immediately or not.
Nov
13
comment what is the difference between `find .` and /home/user/* as an input to for command
ls --quoting-style=shell would not help. Only literal quotes are actually treated as quotes. Any quote characters that happen to result from expansions are not special. You would have to use eval to get the shell to reparse expanded output, and I would not really recommend that.
Nov
13
comment Script to see if user has logged off
You could simply change until to while, but I do not think this is the most efficient or elegant method to be notified of user login activity.
Nov
12
comment any way to get rotation cube on xmonad/i3
Considering how compiz is a window manager and xmonad is a window manager, I'd guess that you can only have one or the other. There isn't a tiling wm that I know of that has compiz-like effects.
Nov
12
comment How to map emacs multi-modifier keys in vim?
This seems to be a quirk of the CTRL-C mapping, which is the interrupt key. For some reason, this mapping only starts working after tweaking the Ctrl-C key in some way. Try imap <C-c> <Nop> followed by iunmap <C-c> and your mapping may start working.
Nov
11
comment For loop for curling on multiple pages with API's
I am not familiar with how that site works. See what you can find out by yourself and then post a separate question if you still need help.
Nov
11
comment For loop for curling on multiple pages with API's
We can't help you because we have no idea what site you are using or how it works.
Nov
10
comment Search 2nd line of files and print filenames to stdout
@chishaku Just use if ($0 ~ /search string/) print FILENAME; instead of print FILENAME ...;.
Nov
8
comment Trying to make aliases that open the last modified file
I'll just leave the standard caveat about Parsing ls output here.
Nov
6
comment How do I analyze report type of data in Bash?
You're going to need to be more specific about what your goal is. It sounds like you need a database, but you haven't actually said what you need to do.
Nov
6
comment For loop for curling on multiple pages with API's
According to the curl manual, you can do this using without a for loop, just curl: cd desktop/mysite && curl --remote-name-all "https://api.mysite.com/info?page=[1-100]"
Nov
6
comment For loop for curling on multiple pages with API's
Use page=$i instead of page=i.
Oct
28
comment How do I add ncmpcpp search results to the current playlist?
@mkaito Maybe your version has different default keys or you have a different key configuration. ncmpcpp keys can be rebound. You can look at the keys in the F1 / 1 menu.
Oct
27
comment Piping bash string manipulation
Considering our recent conversation about how tr / sed are faster than bash at string processing, and considering how you are using pipes to pass strings via standard I/O, I see literally zero point to doing those operations in bash as opposed to tr / sed. Why would one ever | { read x; echo $x... } as opposed to a | sed that does the same thing?
Oct
27
comment Piping bash string manipulation
@Miati Why would you think this extra read x; echo $x is any better for performance? The syntax does not look any shorter or cleaner. x=${x// /_}; x=${x^^} is a much more concise way to do the same thing as {read x; echo ${x.... As far as performance goes, @jimmij has pointed out that tr / sed would be faster than bash, fork count being equal. Using a pipe always results in an extra process so the argument of saving a fork no longer applies. Thus, if are using pipes, just use sed / tr etc. If you can do it in bash, do so and skip this read x; echo $x nonsense.
Oct
27
comment Piping bash string manipulation
@jimmij Fair enough. For 90% of use cases where bash performance matters, I suspect the strings will be small enough where the penalty of process creation outweighs the benefits of faster regex handling.
Oct
26
comment Piping bash string manipulation
@jimmij Are you claiming that bash's string manipulation code is so inefficient compared to sed or awk that it is more efficient to fork off an extra process to run the better code in sed / awk than it is to use bash's code? I find that to be unlikely - if bash can do something it should be faster than forking a process to do the same thing. As to the other point, if you have a string so big it won't even fit in a bash variable then the performance question is moot.