20,900 reputation
34677
bio website
location United States
age
visits member for 3 years, 5 months
seen 15 hours ago

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


Mar
22
revised Is it possible to reference the most recently modified file in a command line argument?
added 1 characters in body
Mar
22
comment Is it possible to reference the most recently modified file in a command line argument?
@user112553 Yes that is a good point. However, it would be trivial to convert the script into a function if the user so desired.
Mar
22
comment Adding a TeX macro to the beginning of a file using sed (why doesn't my method work?)
@ChrisDown Just saw this again. You are indeed correct about -i removing symlinks, although GNU sed provides the --follow-symlinks option for that case. Of course all of this is rendered moot by the more important point that sed -i is non-portable and should be avoided anyways.
Mar
22
revised Is it possible to reference the most recently modified file in a command line argument?
added 202 characters in body
Mar
22
answered Is it possible to reference the most recently modified file in a command line argument?
Mar
22
comment Is it possible to reference the most recently modified file in a command line argument?
There is no way to do this with bash that is both simple and foolproof. I believe zsh can do this with the *(om[1]) glob.
Mar
22
comment What is the difference between : and true?
Related question about the purpose of the colon builtin.
Mar
20
comment How to rename multiple files by removing the extension?
Safer faster version: for i in ./*.tif; do mv -i "$i" "${i%.tif}"; done
Mar
20
comment Utility for sending HTML mail with attachments to a long list of emails?
@MichaelMrozek Indeed, the mutt wiki seems almost ashamed to admit it. Apparently it was a frequently requested feature though.
Mar
20
comment Utility for sending HTML mail with attachments to a long list of emails?
@MichaelMrozek Well ... built-in SMTP was added to recent 1.5.x versions of mutt.
Mar
13
comment Problem with vim when logged in as root
Some distros set up /usr/share/vim/vimrc as a symlink to /etc/vim/vimrc.
Mar
12
comment Bulk rename files with numbering
mv "$f" Image0"${f#Image4}" is a much faster and safer way to do this. The $( echo | sed ) approach, even if it works on filenames like Image401.jpg, is not very robust as it will mangle filenames containing odd characters or spaces, and is much slower because of the extra temporary subshell and processes created for every single file.
Mar
11
comment Character classes: construct my own
I don't know very much about this but you could probably accomplish this with a custom LC_CTYPE setting. It may require defining a custom locale.
Mar
8
revised Why does awk print on non-null strings and positive numbers
typo fix
Mar
8
comment Need help to make rows into column with awk or sed
@manatwork Thanks. The * is kept in for maximum portability.
Mar
8
revised Need help to make rows into column with awk or sed
deleted 5 characters in body
Mar
8
revised Path is there, but cannot call one program without specifying path
deleted 8 characters in body
Mar
8
revised Need help to make rows into column with awk or sed
deleted 31 characters in body
Mar
8
comment Need help to make rows into column with awk or sed
@AlanFok What I meant was that the question that you posted has been answered. If that's not what you really wanted to ask, update the question. Don't expect people to read your mind or know what your system looks like.
Mar
8
comment Need help to make rows into column with awk or sed
@AlanFok You should put what you want in the question if you want people to be able to help you.