2
votes
1answer
15 views

zsh: how to get file expansion working in print statement

I have the following code which prints recursively all files inside /usr/local/include: % files=(/usr/local/include/**/*(^/)) % print -l $files Is it possible to get rid of the temporary variable? ...
3
votes
4answers
257 views

How to prepare files for rsync on a case insensitive filesystem?

I am transferring a large number of files on a HFS+ filesystem. The files are currently on ext2 partitions. I have conflicts due to case insensitivity of the target partition (HFS+). I want to ...
5
votes
4answers
487 views

Portable way to get script's absolute path?

What is a portable way for a (zsh) script to determine its absolute path? On Linux I use something like mypath=$(readlink -f $0) ...but this is not portable. (E.g., readlink on darwin does not ...
15
votes
0answers
281 views

Completing avfs fake directories in zsh

How can I tweak zsh's completion system to complete “fake” files in some circumstances? More precisely, the AVFS filesystem exposes archives as directories by creating a “fake directory” next to ...
0
votes
1answer
235 views

Checking existence of file with underscore in file name in zsh

I am writing a very simple script which will link shared configuration files. For some reason it does not behave as i expected for file with underscore in name. Does _ (underscore) means something ...
3
votes
2answers
511 views

Renaming files in lexicographical order with a numerical pattern that increases sequentially with fixed padding

I have files such as a bb ccc abc emrls I would like to rename them so that, after sorting them (for example, lexicographically), each file gets the following name: 00001 00002 00003 etc where ...