Hacker Newsnew | past | comments | ask | show | jobs | submit | i15e's commentslogin

You can use Ctrl+z to suspend the foreground process, bg to resume it in the background, and then wait to wait for it to complete. By default wait will wait for all jobs to finish and then return a success exit code, however if you give it a specific job ID it will instead return the exit code of the waited-on process:

    $ (sleep 10; false)
    ^Z
    [1]+  Stopped                 ( sleep 10; false )
    $ wait %% && echo ok || echo nok
    [1]+  Exit 1                  ( sleep 10; false )
    nok


Great! And no plugins or scripts needed. Thank you!


You could install the Google Drive client and then run WinDirStat against the virtual drive letter that it creates:

https://support.google.com/drive/answer/10838124


I have done this before, and it works, but the client downloads every single file locally in the background before it's able to do the comparison. I suspect this is because WinDirStat requests metadata about the file itself, and the sync client needs to download the files in order to serve that metadata and/or file contents information to the application.


In Firefox you can go to about:profiles to easily open new windows using other profiles. I bookmark that page with a keyword for quick access. (Also see about:about for a list of other handy 'about' pages)

A more classic-style profile switcher is available via the '-P' (or '-ProfileManager') command-line switch. If FF is in your $PATH you can run:

  firefox -P
The '-P' switch can also take an argument of a profile name to open it directly.

But yes, it would be nice if at least one of these options were exposed in the UI so it was more discoverable by users.


That's not user friendly or works on all OS (eg: firefox -P). There are also other issues with Firefox profiles. For example, on macOS, using different profiles mess up Firefox's icons on the dock and profiles always open behind the current Firefox window.

There's no way around this. Profile support on Firefox is bad and it's a shame because they've had them for years.


I currently have a firefox -p shortcut, but it's auch worse experience than on chrome and friends.


gf2 is worth looking at: https://github.com/nakst/gf


Wow! I just tried it out, and that was like a dream come true. Thank you for linking this.


Something to watch out for with nl is that by default it doesn't number empty lines. e.g.:

  $ printf 'one\n\nthree\n' | nl
     1  one

     2  three
Set -ba to enable numbering all lines.

For this use case I usually end up running cat -n instead since I find it easier to remember.


Your original command should work fine.

find does not pass arguments through an intermediate shell, so there are no quoting concerns with regard to spaces in filenames, etc.

And with the form of -exec terminated by a ; it runs a single command for each matching filesystem entry, so there will be no issues with exceeding the maximum argument size.

You can verify via strace:

  $ touch 'a b.md' 'c d.md'
  $ strace -fe execve find . -iname '*.md' -exec unbuffer ls {} \;
At the end of the exec chains you should see the following:

  execve("/bin/ls", ["ls", "./c d.md"] ...
  execve("/bin/ls", ["ls", "./a b.md"] ...
The filenames are being passed through spaces and all.

However if this were a real scenario, a better solution might be:

  find . -iname '*.md' -exec unbuffer ls -1 {} +
(Look up the -1 flag for ls, and the + variant of -exec for find for details)


This is a great reply! Makes me weirdly glad that I posted further mistakes about my earlier ones. :)


I did something similar using the 'at' daemon's 'now' time specification to "fork" off background tasks from a web request using the same .php file. It actually worked well for what I needed at the time!


Another plus of DroidCam is that it supports streaming the video over USB so no WiFi is necessary.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: