Sponsored Content
Top Forums Shell Programming and Scripting Format your scripts with shfmt Post 302981297 by mvdan on Friday 9th of September 2016 01:57:50 PM
Old 09-09-2016
> How will your parser cope with this line and others in that script you have to test with?

The parser of course does not have problem with long lines.

The formatter does not do anything about long lines, as there is no good solution to split lines. This should be done by humans, if they wish to.

> in my experience enforced formatting practices usually make things less readable and harder to edit.

Less readable is subjective, and harder to edit is until you get used to it. In my opinion, the tradeoff is worth it once there are multiple people maintaining a software. Otherwise, you can easily get to a point where pieces of the software are written in wildly different formats.

Diffs become bigger than they need to be, merge conflicts on the rise, readability decreases as noone is happy, etc. Those are simply irrelevant for scripts you develop on your own.
This User Gave Thanks to mvdan For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Want to Convert Scripts in Linux format

I have scripts which I want to convert in Linux format. Note these scripts are in txt format.But I want to convert them in Linux, as DBA's will be using this script. Any command or utility which converts tht files in proper Linux format. Thanks in Adavce. Kunal (1 Reply)
Discussion started by: niceboykunal123
1 Replies

2. UNIX for Dummies Questions & Answers

Profile scripts versus rc scripts....

what is the difference between login and profile scripts versus the rc scripts? (1 Reply)
Discussion started by: rookie22
1 Replies

3. Shell Programming and Scripting

Help with Script using rsh and scripts within scripts

Hi, I've written a script that runs on a Database server. It has to shutdown the Application server, do an Oracle Dump and then restart the Application server. Its been a long time since I wrote any shells scripts. Can you tell me if the scripts that I execute within my script will be executed... (3 Replies)
Discussion started by: brockwile1
3 Replies

4. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

5. Shell Programming and Scripting

Shell scripts for record Re format

I have few files from windows which are tab delimited or ‘|' delimited files. I need to convert these files without any delimiter ( so in a way it would become variable length with no delimiter ) Can someone help me with the command in bourne shell scripts., ( I am trying with awk ) Thanks In... (6 Replies)
Discussion started by: Shanks
6 Replies

6. UNIX for Dummies Questions & Answers

Shell Scripts - shows today’s date and time in a better format than ‘date’ (Uses positional paramete

Hello, I am trying to show today's date and time in a better format than ‘date' (Using positional parameters). I found a command mktime and am wondering if this is the best command to use or will this also show me the time elapse since 1/30/70? Any help would be greatly appreciated, Thanks... (3 Replies)
Discussion started by: citizencro
3 Replies

7. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

8. UNIX for Dummies Questions & Answers

converting scripts from dos 2 unix format

Hi, I am new to shell scripting and exploring it , I have developed few sample shell script but I have developed them on windows xp notepad and then saving them on folder and then testing them on cywgin and running perfectly...but these scripts are in dos format and I want to convert them in unix... (1 Reply)
Discussion started by: rahul125
1 Replies

9. Shell Programming and Scripting

Calling multiple scripts from another scripts

Dear all, I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out. Here is the snippet:- #!/bin/bash HSFILE=/root/Test/Components.txt LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Discussion started by: sharsour
3 Replies
QUICKBOOK(1)							   User Commands						      QUICKBOOK(1)

NAME
Quickbook - WikiWiki style documentation tool geared towards C++ documentation DESCRIPTION
QuickBook is a WikiWiki style documentation tool geared towards C++ documentation using simple rules and markup for simple formatting tasks. QuickBook extends the WikiWiki concept. Like the WikiWiki, QuickBook documents are simple text files. A single QuickBook document can generate a fully linked set of nice HTML and PostScript/PDF documents complete with images and syntax- colorized source code. Features include: * generate BoostBook xml, to generate HTML, PostScript and PDF * simple markup to link to Doxygen-generated entities * macro system for simple text substitution * simple markup for italics, bold, preformatted, blurbs, code samples, tables, URLs, anchors, images, etc. * automatic syntax coloring of code samples * CSS support Allowed options: --help produce help message --version print version string --no-pretty-print disable XML pretty printing --indent arg indent spaces --linewidth arg line width --input-file arg input file --output-file arg output file --debug debug mode (for developers) --ms-errors use Microsoft Visual Studio style error & warn message format -I [ --include-path ] arg include path SEE ALSO
The full documentation for Quickbook is maintained in HTML; see /usr/share/doc/libboostX.Y-doc/HTML/doc/html/quickbook.html Quickbook Version 1.4 July 2009 QUICKBOOK(1)
All times are GMT -4. The time now is 02:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy