You are not logged in.
Pages: 1
hi im working on a script that uploads stuff to my site, i was wondering how i could read from stdin e.g.:
wl-copy "aa"
wl-paste | scripthere is my script https://git.system72.dev/dotfiles/tree/.local/bin/store
be patient with me pls i am a shell scripting n00b
Last edited by system72 (2025-12-06 11:31:37)
Offline
For example by marking stdin input with the lack of filename argument or it being set to ‘-’ (a single dash). This is a pretty common way.
Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!
Offline
For example by marking stdin input with the lack of filename argument or it being set to ‘-’ (a single dash). This is a pretty common way.
can you show me an example of how it would be implemented
Offline
Implementing which part is a problem? You already know `if`.
Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!
Offline
idk how to read from stdin
Offline
`cat` without arguments reads from stdin. You may redirect output to to a file:
cat >fileThen you can rsync the file to the server.
One can’t directly rsync from stdin. The tool is designed to work with actual files in storage. It’s possible to coerce rsync into accepting data from stdin, but AFAIK there is no way to reliably make it not getting grumpy about that.
Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!
Offline
ok ty this seems to work..
Offline
Pages: 1