wisecracker, you can split long lines like that with a backslash:
This does not actually add newlines to the resulting string, as you see.
I hope I don't have code formatting practices imposed on my scripts... in my experience enforced formatting practices usually make things less readable and harder to edit.
I am actually well aware of that except I was wondering if the parser would chop at exactly 80 characters of which case the could corrupt the data if in mid flight inside a 4 character '\x??' string.
I treid it and it does corrupt.
Results:-
As it is mvdan has adequately explained his position.
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT DEBIAN
gofmt
GOFMT(1) General Commands Manual GOFMT(1)NAME
gofmt - formats Go programs
SYNOPSIS
gofmt [flags] [ path ... ]
DESCRIPTION
Without an explicit path, it processes the standard input. Given a file, it operates on that file; given a directory, it operates on all
.go files in that directory, recursively. (Files starting with a period are ignored.) By default, gofmt prints the reformatted sources to
standard output.
OPTIONS -d Do not print reformatted sources to standard output. If a file's formatting is different than gofmt's, print diffs to standard out-
put.
-e Print all (including spurious) errors.
-l Do not print reformatted sources to standard output. If a file's formatting is different from gofmt's, print its name to standard
output.
-r rule
Apply the rewrite rule to the source before reformatting.
-s Try to simplify code (after applying the rewrite rule, if any).
-w Do not print reformatted sources to standard output. If a file's formatting is different from gofmt's, overwrite it with gofmt's
version.
Formatting control flags:
-comments=true
Print comments; if false, all comments are elided from the output.
-tabs=true
Indent with tabs; if false, spaces are used instead.
-tabwidth=8
Tab width in spaces.
The rewrite rule specified with the -r flag must be a string of the form:
pattern -> replacement
Both pattern and replacement must be valid Go expressions. In the pattern, single-character lowercase identifiers serve as wildcards match-
ing arbitrary sub-expressions; those expressions will be substituted for the same identifiers in the replacement.
When gofmt reads from standard input, it accepts either a full Go program or a program fragment. A program fragment must be a syntactically
valid declaration list, statement list, or expression. When formatting such a fragment, gofmt preserves leading indentation as well as
leading and trailing spaces, so that individual sections of a Go program can be formatted by piping them through gofmt.
EXAMPLES
To check files for unnecessary parentheses:
gofmt -r '(a) -> a' -l *.go
To remove the parentheses:
gofmt -r '(a) -> a' -w *.go
To convert the package tree from explicit slice upper bounds to implicit ones:
gofmt -r 'a[B:len(a)] -> a[B:]' -w $GOROOT/src/pkg
BUGS
The implementation of -r is a bit slow.
AUTHOR
This manual page was written by Michael Stapelberg <stapelberg@debian.org>, for the Debian project (and may be used by others).
2012-05-13 GOFMT(1)