-4

How to use redirectors and built-in shell functions in hotkey commands?
I'm using the following line to grep in anacrontab, and kick-off an system update Ansible playbook: hotkey

redirectors
I'm wondering why lines with a pipe (|) do not work: echo piping | logger. No error is shown. Instead logger hi can do the job in this example. How come this happens? Is there another way to use redirectors?

build-in shell functions
There is an error message for bash build-in shell functions such as read. read
Translation: Execution of child process read failed (File or folder does not exist)

Hope someone could explain what actually happens when a hotkey command is invoked :). And point out an alternative.

  • idownvotedbecau.se/imageofcode, idownvotedbecau.se/imageofanexception, and a translation of the messages would also be helpful, as most people around here don't speak dutch. – Murphy Jan 14 '18 at 9:11
  • Did you try enclosing the command in double quotes? "echo piping | logger" – Murphy Jan 14 '18 at 9:12
  • Hey slimmerik, niet iedereen spreekt hier Nederlands ... (for those who don't understand dutch/Flemish: hey, not everybody speaks Dutch around here ...). Hurry to translate it all to English, and do not use "images" ... – Pierre.Vriens Jan 14 '18 at 9:23
0

Try sh -c 'command1 | command2'

  • Got what I wanted using: bash -c "$(grep -P --color -o '(?<=system-maintenance.daily).*' /etc/anacrontab | sh -)" Thank you so much :). – Eimert Jan 15 '18 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.