Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    problem with ambiguous redirect

    hello i have problem with creating file :/

    ls > file.<'date +%Y%m%d'>.log 2>> ~/tom/error.log

    i wanna get something like this

    some1 can help me?


  2. #2
    two problems:

    1. you have to replace the single quotes with backticks

    2. you have to escape the greater/less than brackets


     ls > file.\<`date +%Y%m%d`\>.log
    however, i would not use the <> chars in a file/dir name. you'll always have to escape the name when using the shell to access it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts