#soylent | Logs for 2023-07-10
« return
[00:09:18] -!- lld has quit [Quit: leaving]
[03:18:02] -!- lld [lld!~lld@2001:f40:yri::zpnl] has joined #soylent
[10:55:59] -!- karmabot has quit [Remote host closed the connection]
[11:41:13] -!- lld has quit [Ping timeout: 252 seconds]
[11:57:54] -!- lld [lld!~lld@2001:f40:jmx::ojop] has joined #soylent
[13:26:16] <fab23> https://www.geekculture.com
[13:26:17] <systemd> ^ 03Your Operating System.
[15:38:43] -!- halibut has quit [Quit: Timeout]
[15:43:57] -!- halibut [halibut!~halibut@CanHazVHOST/halibut] has joined #soylent
[15:49:49] -!- AzumaHazuki has quit [Ping timeout: 252 seconds]
[17:15:04] -!- norayr has quit [Ping timeout: 252 seconds]
[18:47:02] -!- soylentil48 [soylentil48!~soylentil@owriu.i.lucanops.net] has joined #soylent
[18:47:38] -!- soylentil48 has quit [Client Quit]
[19:07:40] -!- Runaway1956 [Runaway1956!~Yet@the.abyss.stares.back] has joined #soylent
[19:52:44] <Bytram> Anyone up for a linux puzzle? (1) I have a file containing 89 lines; each of which has a YouTube ID (see below) and (2) a directory tree in which I am looking. The goal is to move all matching files to a new directory.
[19:52:51] <Bytram> BEGIN
[19:53:56] <Bytram> IRXJVAy9aFI
[19:53:57] <Bytram> OiZwp8ygR9w
[19:53:57] <Bytram> U2Uu26P25Tg
[19:53:57] <Bytram> ZUN3v4-Ba-8
[19:53:57] <Bytram> 7aY6_i7WNY4
[19:53:57] <Bytram> 2cVcdqD3nzQ
[19:53:58] <Bytram> GAcwBednB3w
[19:54:00] <Bytram> 2WYx_BVb16s
[19:54:02] <Bytram> xf0R9RbUqVE
[19:54:04] <Bytram> -LeDuaP3pJI
[19:54:08] <Bytram> END
[20:17:15] <mechanicjay> So, like a duplication detection?
[20:17:53] <mechanicjay> no, not quite -- a file full of strings, a directory full of files
[20:19:14] <mechanicjay> should be a pretty simple 4-5 line bash script
[20:29:02] <mechanicjay> Bytram: EXTREMELY STUPID solution -- no checking, just a mv (which works if the file is there, errors if it doesn't): http://archives.smbfc.net
[20:29:29] <mechanicjay> One could make this much better by doing a check to see if the file exists first before attemping the mv
[20:49:31] <chromas> Ain't nobody got time for error checking
[20:54:36] <mechanicjay> man, that's so quick-n-dirty I'm starting to feel ashamed
[20:54:48] <mechanicjay> I should have at least added sourcedir and destdir variables
[21:06:32] -!- some [some!~Yet@154.6.nw.r] has joined #soylent
[21:08:49] -!- Runaway1956 has quit [Ping timeout: 252 seconds]
[21:18:47] <Bytram> mechanicjay: Maybe it's my NoScript settings or something? If it is that short, maybe post it here or PM it to me?
[21:31:57] -!- norayr [norayr!~norayr@37.252.sq.ypj] has joined #soylent
[22:04:32] <halibut> In case you did not get mechanicjay's script, I think this will also work (just sub in the correct values for SRC and DST):
[22:04:35] <halibut> SRC=PATH_TO_FILE ; DST=DESTINATION_DIRECTORY_PATH ; while read -r NAME ; do [ -r "$NAME" ] && mv -i -- "$NAME" "$DST" ; done <"$SRC"
[22:21:27] <inz> The read access check seems funny; read access not needed for movong file
[22:23:29] <halibut> Could have been an existence check (-e instead of -r). I typically lean towards -r in most cases, since typically if you do not have read access, you probably are not the owner (and so probably should not move the file).
[23:13:00] <Bytram> The problem is that -- over time -- I have found files on YouTube. I'd download each file (but who knows what inconsistent directory/filename location). Let's say these are located somewhere under my YouTube directory. I recently found a URL online that seems to point to many (but by no means all -- I'm missing some) of these. I would like to gather the files I *do* have into ONE directory. I have written some code to extract the
[23:13:01] <Bytram> YouTube "ID" from these 89 YouTube URLs. (see above) If I *do* have a file, move it to a DEST directory. If I *don't* have a file, then download to DEST dir.
[23:27:26] <chromas> Just download them all. Yt-dlp will figure it the ones it already has
[23:29:16] <chromas> Unless you renamed them or something
[23:32:49] <mechanicjay> Ah, you want to DL too, missed that part