Re: BASH lint

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

 



Bill Gradwohl wrote:
Gordon Messmer<yinyang@xxxxxxxxx> 10/16/03 07:02PM >>>

Use emacs' indenting features. when you miss a special character, indents get real funny.

I just tried making the same mistake I made a week ago and I saw nothing special in the indentation. Maybe its because I'm using xemacs and you're using emacs.

if [ test -e /tmp ] ; then ( cd /tmp && ls ) pwd fi

That looks right... now drop a close paren and re-indent (highlight the block and run the emacs function "indent-region":

if [ test -e /tmp ] ; then
	( cd /tmp && ls
		pwd
fi

The parts of the block that were not supposed to be included in the sub-shell are now indented beyond what you would expect. This example is perhaps too short to be effective by itself, but try dropping one of the block closing characters in your own code and use "indent-region" to see if things turn out as you'd expect.

In some modes, a block reformat is easier than others. In C mode, for instance, C-c C-q will find the beginning and end of any function or block of code that the cursor is in, and reformat it.


-- Shrike-list mailing list Shrike-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux