[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: text editors



On 3/25/19 12:47 PM, rhkramer@gmail.com wrote:
> There are equivalent approaches in bash, but I forget them (in bash, it might
> be a little more convoluted, like an external / 3rd file that assembles a new
> file from the read-only and read / write files.

Good Day rhkramer,

Perhaps I missed some points, but wouldn't `.`, or `source`,
command do the trick, instead of building a script dynamically?

readonly.sh:
	# Don't touch that!
	PATH="/opt/thirparty/bin:$PATH"
	CPATH="/opt/thirparty/include:$CPATH"
	LD_LIBRARY_PATH="/opt/thirparty/lib:$LD_LIBRARY_PATH"
	export PATH CPATH LD_LIBRARY_PATH

main.sh:
	#! /bin/bash
	set -e
	# Loading environment from read only file
	. readonly.sh
	printf 'Using libraries in %s\n' "$LD_LIBRARY_PATH"
	do_stuff_with_thirdparty_program

If I need some configuration, or a sort of shell functions
library, this is something I would consider.

Kind Regards,
-- 
Étienne Mollier <etienne.mollier@mailoo.org>

All opinions are my own.



Reply to: