Hello all
I wander if I make for example " ls -l "
And it gives me all the files in the directory with the additional info like data size and privileges
But what if I like to filter the stout result for example by date
When I try to do:
echo "`ls -l`" | grep "Jan 12"
it gives me the... (2 Replies)
Hi All,
I have created a Unix Shell script whch creates a *.csv file and export it to Excel.
The problem i am facing is that Users wants one of the AMOUNT field in comma separted values. Example :
if the Amount has the value as 3000000 User wants to be in 3,000,000 format.
This Amount format... (2 Replies)
I have a function called sysLogger in a bash script that I am using to redirect stdout and stderr to syslog.
Part of the script contains an option to turn on debugging otherwise I want debugging output to go to /dev/null.
I am struggling to understand how to make this work using the function... (10 Replies)
Hi,
I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix.
My requirement here is that i want to do it automatically using a... (5 Replies)
should be the simplest thing in the world use grep
but i not get it
i have several files, in this files i need to khow how many times the words are repeated but the files must star whit P_
this work
egrep -c "word1|word2" *P_*
result:
P_11351814:1
P_11351823:3
P_11351826:1... (2 Replies)
Hi, I am trying to write the simplest network driver that would send whatever through cable.
My configuration is:
Linux machine with some Intel network adapter
Another machine with WireShark
I connected Intel network adapter to second machine and want anything to pop up at wireshark.
... (12 Replies)
I'm not a Linux newbie but this seemed like a pretty n00b question. I am familiar with Postfix/Dovecot setups but now I am looking for the simplest way to access mail on a Linux system, such as the mail that goes to /var/mail/root. I know I can edit /etc/aliases and have the system mail go straight... (6 Replies)
Discussion started by: TayKimchi
6 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)