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

Re: a quick tip that sometimes saves a lot of further worries



> On Thu, Oct 25, 2018 at 11:02 AM songbird <songbird@anthive.com> wrote:
>>   now the really nice feature would be if i actually
>> made this into a system where my vi editor would
>> automagically scroll it for me in some window...
>> that will be for some other time.  i don't want to
>> get sidetracked any more for the moment.  gardens
>> are sidetracking me enough...
>>

On 10/25/18 9:10 PM, Nicholas Geovanis wrote:
> Don't be afraid to use your backups (that you don't make.....)
> I once restored most of a root filesystem I had deleted from a
> running server. The server stayed up the whole time, through
> the mess-up and the restore. Things like /lib.
> DEC Alpha running OSF/1  :-)
> And.....was OSF/1 ever open-sourced?
>

Even though I kind of agree with Nicholas, your concept is quite
amusing.  :-)

Would that shell function do the kind of thing you would expect?

	vi () {
		local arg
		for arg in "$@"
		do
			if [ -f "$arg" ]
			then
				printf '<<< %s >>>\n' "$arg"
				cat "./$arg"
			fi
		done
	
		command vi "$@"
	
		for arg in "$@"
		do
			if [ -f "$arg" ]
			then
				printf '>>> %s <<<\n' "$arg"
				cat "./$arg"
			fi
		done
	}

Feel free to refine to your taste.
Kind Regards,
-- 
Étienne Mollier <etienne.mollier@mailoo.org>


Reply to: