19,067 reputation
23971
bio website
location United States
age
visits member for 2 years, 11 months
seen 7 hours ago

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


May
5
comment Have backticks (i.e. `cmd`) in *sh shells been deprecated?
@mikeserv ((expression)) is a bash-ism. At this point you have lost me. What are you talking about?
May
5
comment Have backticks (i.e. `cmd`) in *sh shells been deprecated?
@mikeserv You should learn the difference between command substitution, subshell, and arithmetic substitution. "(parens) has issues nesting (parens)" means absolutely nothing because (parens) is not a thing. Are you talking about command substitution, arithmetic expansion, or subshells? All of them nest just fine.
May
5
comment Have backticks (i.e. `cmd`) in *sh shells been deprecated?
@mikeserv There are no issues nesting subshells in command substitutions as long as you read and follow the standard carefully. This standard requires that conforming applications always separate the "$(" and '(' with white space when a command substitution starts with a subshell. There, problem solved. The standard says that $((subshell)) parsing is unspecified behavior and varies by implementation, so if you write that and get non-portable behavior, that is your own fault. This seems like a really desperate attempt to "justify" the use of backticks. It's not working.
May
2
comment How to fix 'set -o emacs' in .bashrc not working in ssh shell
ssh starts an interactive login shell. bash does not read .bashrc when started as an interactive login shell.
May
2
comment last time file opened
According to the mount manpage, relatime has nothing to do with daily limits, but only looks at the atime relative to mtime and ctime. If atime is older than mtime or ctime, atime is updated. If atime is newer than both, then it is left alone. The purpose of this is to preserve the relation between atime and mtime / ctime, since some applications use that information, like mutt to see if it has read your mailbox since it was last updated.
Apr
30
comment Have backticks (i.e. `cmd`) in *sh shells been deprecated?
You may want to add the following quote from the POSIX standard rationale: Because of these inconsistent behaviors, the backquoted variety of command substitution is not recommended for new applications that nest command substitutions or attempt to embed complex scripts. While this is not a formal deprecation since the rationale section is informative and not normative, it does suggest that continued use of backticks should be avoided.
Apr
30
comment Path independent shebangs
You use a single file, not two files. The package has one file modify another file. You have a file modifying itself. There is a distinct difference between these two cases. A file that takes input and produces output is fine. An executable file that changes itself as it runs is generally a bad idea. The example you pointed to does not do that.
Apr
30
comment Path independent shebangs
I assume this is the command -v example you were talking about from man sh. That is a normal-looking installer script, and not a self-modifying one. Even self-contained installers only contain pre-modification input, and output their modifications somewhere else. They don't rewrite themselves the way you are recommending.
Apr
30
comment Path independent shebangs
please see man command for a contradictory opinion - not finding one. Can you direct me to the specific section / paragraph you were talking about?
Apr
30
comment Path independent shebangs
The downvote is because self-modifying code is generally considered bad practice. Back in the old days of tiny assembly programs it was a clever way to reduce conditional branches and improve performance, but nowadays the security risks outweigh the advantages. Your approach would not work if the user who ran the script did not have write privileges on the script.
Apr
24
comment What privileges do I have (find out within bourne shell script)
You are using mode 0600 (u=rw) which lacks the execute bit which is required for a directory in order to create files inside it.
Apr
23
comment scp to Local Machine After SSHing
I second the sftp suggestion. However I would also suggest not using really complicated & annoying paths. If they are annoying to type why type them? Name them something easier to type. Finally, I would suggest using single quotes instead of double backslashes because double slashes are harder to read. Instead of ...\\\ \\\&..., you could just do '...\ \&...'. See how much more readable that is?
Apr
18
comment rkhunter /usr/bin/ssh && /usr/sbin/sshd [Warning]
If the ssh and sshd binaries changed by themselves, and you are sure you didn't do it, that seems very suspicious. What kind of server is this?
Apr
18
comment SSH: “Connection closed by remote host” randomly while working on an interactive session
I would contact the server admin, who actually might have a clue, instead of asking for wild speculation.
Apr
17
comment Port forwarding with ssh where the final destination does not have sshd running
By connecting to your local port 7000.
Apr
17
comment Port forwarding with ssh where the final destination does not have sshd running
Not entirely sure what you are asking, but the ssh port forwarding is just a generic TCP forwarder. Any TCP connection can be established over the forwarded link, not just ssh. As long as the Windows machine port 3389 is a TCP service the forward should work.
Apr
16
comment top: how to cancel current command?
Blank input seems to work for me (press Enter without typing anything). ^D works for me too so I don't kno why it doesn't for you.
Apr
15
comment Seemingly Inconsistent Behavior for “ln” & “ln -s”
@trysis The way you "see" it is non-standard usage and you are just going to confuse everyone else by insisting on using the words that way. In Unix-land, links are hard by default, and non-hard links are called symbolic. This is reflected in the naming of the system calls link(2) and symlink(2).
Apr
14
comment How to display “human-readable” file sizes in find results?
The man page is simply advocating some unnecessary caution. It won't hurt, but I am not aware of any shell that requires {} to be quoted.
Apr
11
comment How to display “human-readable” file sizes in find results?
The -a option to ls is unnecessary since the arguments are expected to be files and not directories. GNU find uses ls -dils for the -ls option, so to replicate that most closely it would be ls -dilsh.