276 reputation
26
bio website
location Milan, Italy
age 23
visits member for 2 years, 8 months
seen 9 hours ago

Physics BSc at Unimi, software developer at Comelz.


Jun
20
comment How to tell “cat” command to not hang on when there is no path provided?
Tip: always do set -u at the start of each script, at least you'll have an indication that there's a problem in the script arguments instead of calling potentially destructive commands with the wrong parameters.
Jun
20
comment How to tell “cat” command to not hang on when there is no path provided?
Honestly, this seems to me like an overcomplication; cat was born to concatenate files, but everybody uses it just to show files contents probably since the first version of UNIX, and I see nothing wrong with that - cat "filename" is way shorter, more portable and more idiomatic than cp filename /dev/stdout.
Apr
22
comment What does exit 99 means?
Great, downvote removed :)
Apr
18
comment What does exit 99 means?
"The shell will get a 0 as the return code" wrong, exit without parameters exits with the status code of the last command run. (see pubs.opengroup.org/onlinepubs/009695399/utilities/exit.html)
Oct
10
comment Why is Linux's filesystem designed as a single directory tree?
@gcb: the point is that the shell hierarchy is not directly usable in "normal" applications. You cannot call CreateFile passing "My Computer" or other shell folders; it's an abstraction understood only by shell-related code, all the kernel calls (and thus 90% of applications, since file management in most languages is implemented in terms of kernel file APIs) know nothing about this stuff. The shell folders are usable only when the programs use the "standard dialogs" (which do understeand the shell namespace) and only when selected files directly map to a "real" (=kernel-understood) path.
Oct
10
comment Why is Linux's filesystem designed as a single directory tree?
@terdon: sorry, wrong "@"; thank you for forwarding. :)
Oct
10
comment Why is Linux's filesystem designed as a single directory tree?
@Phoshi: actually, there's some GUI for that - just go in disk management, right click on a volume, there's a voice like "change drive letter and mount point" and you can mount drives on any NTFS empty folder.
Oct
8
comment Why is Linux's filesystem designed as a single directory tree?
@terdon: he would just mount the drive inside a directory - exactly like you do in POSIX OSes.
Oct
8
comment Why is Linux's filesystem designed as a single directory tree?
Actually, C:, D: and stuff is just compatibility with DOS and Win32; Windows NT internally has a somewhat UNIX-like object hierarchy, were the drive letters (and in general Win32 stuff) are just symbolic links to the "real" objects (c:\file.txt is actually \??\c:\file.txt, with \??\c: being a symlink to e.g. \device\harddisk0\partition1). See e.g. here
Sep
15
comment How can I run a command in zsh without pushing it onto the current session's history?
If I use your shortcut in bash I don't see the command even in the current session's history (GNU bash 4.2.24).