I have been building a local library of .mac
files, and calling them from a single .mac
file containing a push
of my local directory & then load
's for each individual script.
This works perfectly on my desktop; however, I also need to copy the full content of all these scripts for use elsewhere (where copies of the files cannot currently be stored, but complete copies of the scripts can be included). Is there some command in Maxima that would allow me to print the content of several files, all at once, so that I can easily copy the output and paste it to another maxima environment?
I'm really looking for any way that would allow me to do this is a single copy-paste (vs. copy-pasting each individual file).
I'm completely new to programming, so it took a while before I considered that this did not have to be achieved from within Maxima but could, for example, be done from the Terminal or anywhere else.
In particular, on MacOS, using terminal, simply navigating to the directory that contains all the files and running the concatenation command
will create a new
.ext
file containing all the files in the current directory, thanks to the wildcard*
.Order may not be respected, depending on the pattern for file names, and the following options can be used for selective inclusion of specific files (as covered in one of the answers to on the unix / linux SE site), included below, for convenience. Full credit to Florin Idita who posted the following concise and helpful explanation.
Lets say you have:
And you want only file01 to file03 and fileA to fileC:
Or, using brace expansion:
Or, using fancier brace expansion:
Or you can use for loop: