Skip to content

Instantly share code, notes, and snippets.

@brennen
Last active May 28, 2020 07:13
Show Gist options
  • Save brennen/ac8a5776eae4a24c9b3ef9d183e27f10 to your computer and use it in GitHub Desktop.
Save brennen/ac8a5776eae4a24c9b3ef9d183e27f10 to your computer and use it in GitHub Desktop.
for gavcloud
[bash] brennen@inertia 23:38:02 ~/fragments/xargs-alias (master m0/u0) $ ls
example_selection files.lftp lst.sh
[bash] brennen@inertia 23:38:06 ~/fragments/xargs-alias (master m0/u0) $ cat example_selection
Datach'i - Bonus - 01 Aldebaran.mp3
Datach'i - Bonus - 02 Something.mp3
[bash] brennen@inertia 23:38:08 ~/fragments/xargs-alias (master m0/u0) $ cat lst.sh
function lst {
echo -n '' > files.lftp
sed "s/'/\\\'/" example_selection | while read -r fname; do
printf "put '%s'\n" "$fname" >> files.lftp
done
}
[bash] brennen@inertia 23:38:11 ~/fragments/xargs-alias (master m0/u0) $ source lst.sh
[bash] brennen@inertia 23:38:13 ~/fragments/xargs-alias (master m0/u0) $ lst
[bash] brennen@inertia 23:38:15 ~/fragments/xargs-alias (master m0/u0) $ cat files.lftp
put 'Datach\'i - Bonus - 01 Aldebaran.mp3'
put 'Datach\'i - Bonus - 02 Something.mp3'
@protrolium
Copy link

thanks a lot for doing this. I am going to study it and see if I can get it to work on my system. right now the lst alias is being loaded from .lftprc I wonder if I can just put the shell script into the same rc file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment