1,629 reputation
18
bio website
location
age
visits member for 1 year, 11 months
seen 17 hours ago

Oct
17
comment Shebang starting with `//`?
following @g-man and Jörg comments below, and according to gilles answer ( unix.stackexchange.com/a/1919/27616 ), this trick should use ///.... instead of //... to be the most compatible!
Oct
16
comment View physical location of a file/directory on a hard disk
@EmmaV: maybe that 512mb FAT volume was at 8gb on the underlying physical disk?
Oct
10
comment How do I auto complete a command from the command history?
#2 matches anywhere in the history line, makes it very nice to find "the few last commands where I operated on THISSERVER" : THISSER[ctrl+r] (and additionnal Ctrl+r to find the older occurences in your history)
Oct
10
comment How do I auto complete a command from the command history?
oh, I missed your answer #2 ... I'll delete my answer
Oct
9
comment How do I delete all of a set of files in a random order?
@StéphaneChazelas: thanks a lot, quite handy trick indeed (if files are not too numerous to fit). I didn't knew printf '%s' * would "loop" over all files, i thought it would try to fit it all in a single %s. thx!
Oct
9
comment Read space as input in shell script
I need coffee... indeed: IFS='' read toto will change IFS just for the duration of the call to read ... (I know this, usually...)
Oct
9
comment Read space as input in shell script
oh; thanks for that quick reply, that I only saw when I typed my 2nd comment ^^ +1, sir!
Oct
9
comment Read space as input in shell script
I found it : OLDIFS="$IFS" ; IFS="" read toto ; echo "__${toto}__" ; IFS="${OLDIFS}"
Oct
9
comment Read space as input in shell script
can we also ensure the beginning and ending spaces are not dropped? read toto ; echo "$toto" : when i enter ______this____ (_ are spaces) it outputs this (I believe this is not something done by read, but by the shell's line policy? how to change it? stty raw before the read, or something?)
Oct
9
comment How do I delete all of a set of files in a random order?
I wonder why you prefer to use "printf" here, instead of a find . -maxdepth 1 -type f -print0 ? (Just reading, as I can not test (no gnu here... :( ), but printf here apparently only add 1 NUL to the entire list of files (all on 1 line, if none have newlines embedded)? Isn't it prone to errors if files have spaces/newlines etc in their pathname? Please explain why this works :) and does sort -Rz shuffle also inside each (here possibly only 1) line?
Oct
6
comment How to remove file log with file name
I wish I could ^^ (and I didn't click twice ;) )
Oct
6
comment How to remove file log with file name
+1 for adressing the root of the problem. And +1 for making me discover explainshell ^^
Oct
2
comment Finding largest file recursively
I believe the (main) goal of the assignment is to use recursion?.. this answer is iterative.
Oct
1
comment How to repair a file system corruption?
If this happens after a brutal shutdown, no worries, it s probably tmp files. If it happened during use, then you should first backup everything important (on 2 separate supports, in case one fails)
Oct
1
comment source my ~/.bash_aliases from a script not in ~/
I see "cp newAliases ~/.bash_aliases" ? newAliases is in the current dir
Oct
1
comment source my ~/.bash_aliases from a script not in ~/
I think it'd be better to give a full path to newAliases, otherwise that function will take whatever "newAliases" file that happens to be in the current dir, or barf that it doesn't find any in current dir
Sep
29
comment How does a terminal emulator work
linusakesson.net/programming/tty
Sep
29
comment cd and ls behave differently when inside a softlink to a dir
.. should be the parent directory of the directory you are in (and should be stored in the inode of the directory you are currently in). There should be no ambiguity. However I do like bash behaviour as I more often want to go back to the directory the link was in (but cd - is often enough to do that, though... and pushd/popd could help if we remember to use them). Imo, default should be to go to physical parent dir, and an option allow to go back to the link's dir (that it is reversed could be for some compatibility/other clever reason?)
Sep
28
answered Finding files on a Unix server and sorting by size
Sep
20
comment How can I make a special file that executes code when read from
May we ask you why you need this? Could be a XYProblem...