Skip to content
Discussion options

You must be logged in to vote

As of August 2025 we have fake gnu utils in DOS!
https://taskfile.dev/blog/windows-core-utils
#2360


You can now just use it directly on DOS

some-task:
    desc: "Mock Minimal Cat"
    vars:
      MY_VALUE:
        sh: '[ -f backup.txt ] && cat backup.txt || echo "my one-ish time command"'
    cmds:
      - cmd: 'echo "{{.MY_VALUE}}" > backup.txt '
      - cmd: 'cat backup.txt'
      - cmd: 'rm -f backup.txt'

You still need to do the test [ -f backup.txt ] because fake cat fails fatally when it can't access the file.
See #2466

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@WesselAtWork
Comment options

@WesselAtWork
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by WesselAtWork
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant