通过这篇文章,我使用以下命令将目录中的所有 .java 文件递归导出为 PDF 格式(files.pdf):
enscript -r -1 --file-align=2 --font=Courier7 --pretty-print=java --line-numbers -o - `find . -name '*.java'` | ps2pdf - files.pdf
这工作正常。但是,当我将以下行添加到我的bash_profile
:
alias printJavaFiles="enscript -r -1 --file-align=2 --font=Courier7 --pretty-print=java --line-numbers -o - `find . -name '*.java'` | ps2pdf - files.pdf"
和来源bash_profile
,运行printJavaFiles
给我一个权限被拒绝错误,我试图打印的每个 .java 文件,如下所示:
bash: ./datastructuretradeoffs/Main.java: Permission denied
bash: ./graphs/Main.java: Permission denied
bash: ./linkedlists/ListNode.java: Permission denied
bash: ./linkedlists/Main.java: Permission denied
bash: ./recursion/Main.java: Permission denied
bash: ./sorting/BinarySearch.java: Permission denied
bash: ./sorting/MergeSort.java: Permission denied
bash: ./stacksqueues/Main.java: Permission denied
bash: ./stacksqueues/MyQueue.java: Permission denied
bash: ./stacksqueues/Node.java: Permission denied
bash: ./stacksqueues/Queue.java: Permission denied
bash: ./stacksqueues/SetOfStacks.java: Permission denied
bash: ./stacksqueues/Stack.java: Permission denied
bash: ./strings/Main.java: Permission denied
bash: ./trees/BinaryTree.java: Permission denied
bash: ./trees/BTreePrinter.java: Permission denied
bash: ./trees/ExampleTrees.java: Permission denied
bash: ./trees/Main.java: Permission denied
bash: ./trees/TreeNode.java: Permission denied
有任何想法吗?谢谢。