Find the answer to your Linux question:
Results 1 to 2 of 2
hello i have problem with creating file :/ ls > file.<'date +%Y%m%d'>.log 2>> ~/tom/error.log i wanna get something like this file.<20120708>.log some1 can help me? tnx...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2012
    Posts
    3

    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
    file.<20120708>.log

    some1 can help me?

    tnx

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    two problems:

    1. you have to replace the single quotes with backticks

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

    e.g.:

    Code:
     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
  •