« first day (1976 days earlier)      last day (2360 days later) » 

6:02 AM
To explain to you why this was presumably closed as off topic, now your post says you're using Ubuntu 16.04 which is perfectly fine and on topic and believable when I look at the kernel version number, but it as well states its Debian stretch, where Ubuntu is based of from lately, but Debian itself is off-topic. Now I'm torn between reopening it or leaving it closed. Giving the benefit of doubt I will vote to reopen it. But please provide the output of cat /etc/apt/sources.list, uname -a and the output of lsb_release -a in your question (edit). — Videonauth 2 mins ago
^cc @Zanna
 
6:17 AM
I do not understand what they are trying to do, but I don't doubt that they are using Ubuntu.
 
hes using a tool to check security on his machine i think but the tool outputs that hes using debian and fails
 
6:35 AM
did we not reopen this yesterday? askubuntu.com/review/close/778799
should we leave a comment?
 
[ SmokeDetector | MS ] URL-only title, bad NS for domain in body, bad NS for domain in title, bad keyword in body, bad keyword in title, +5 more: www.nutritionfit.org/magnetique-hair-growth/ by Afte1930 on askubuntu.com
 
 
3 hours later…
9:16 AM
not off topic (i'm not feeling up to commenting today)
 
9:43 AM
@Zanna I've commented.
 
seems off topic? (I would say #1 not-Ubuntu rather than #4 no-repro, since if the last comment is correct, the reason is nothing to do with Ubuntu and there's no way to discover that reason using Ubuntu or solve it using Ubuntu, but it's not as if it we couldn't get the same issue if we tried the same thing)
@EliahKagan thanks a lot!
 
10:02 AM
Unclear, but is there something we can ask to help them make it clearer?
 
@EliahKagan the answer should be a comment on the answer above and the comment on it a reply on this comment, ,already flagged for mod attention
 
@Videonauth Thanks.
@EliahKagan I've improved my comment. It used to be that 1-rep users could flag their own posts so long as their accounts were registered. I'm assuming that's still the case, but is it?
Also I'm hoping maybe that whole question is a duplicate of something else?
 
10:24 AM
We have Environment variables when run with 'sudo', but is that suitable?
(unrelated) This needs a better title but I'm about to go afk.
 
11:04 AM
@EliahKagan I edited it, but I wasn't able to give it proper attention
@EliahKagan I commented, but not sure my comment will help
 
 
8 hours later…
8:35 PM
This and that are NAA.
 
9:07 PM
This question is almost answered in a comment, and someone should remember to post an answer if the commenter does not do so. (Really it would be fine to post one at any time--as it always is in such situations--but I'm personally hoping the commenter will post the answer.)
 
9:20 PM
im not much use when it comes to awk
sasly
if i would like the last line of a file i simply use tail -n 1 data.dat
 
As the first comment says, the answer is just to leave out the print that appears inside the first { } block.
The OP wants the last sum, not the last line.
 
so awk '{sum +=$1} END {print $sum}' file.dat ?
mhmm makes sense so it sums up the 1st number of each line to an overall sum?
 
That, but without the $ in front of sum in the END block.
 
mhmm ok let me still read up a bit i want to understand what im asnwering about
 
$sum is the sumth field from the most recent record.
 
9:32 PM
well answered but i feel there could be said more about it, or what do you think?
>Next: Invoking Summary, Previous: Obsolete, Up: Invoking Gawk [Contents][Index]
>2.10 Undocumented Options and Features
>
> Use the Source, Luke!
>
>— Obi-Wan
>
>This section intentionally left blank.
hahahaha
@EliahKagan did you see the video i linked in here earlier? this was very inspiring and very very interesting
 
It looks fine. You might consider rewording the last sentence of your answer to state the behavior they're experiencing in a way that makes the connection clear. For example you could say, "Telling awk to print the sum every time you add a new value to sum makes it show each intermediate value, just as you have experienced." Feel free to use that, with or without rewording, if you like. I don't think there's anything wrong with your answer right now though.
I have not yet watched that video, no.
 
this is dutch guy talking about his time he was working at a university and the first Unix licenses where given out and how he met ken thompson and dennis ritchie
and how unix looked like in the very first days
why some programs have the name they have today still and so on
 
You may also want to apply syntax highlighting. The command itself is for the shell, and the AWK script is quoted, so you'd use code highlighting for the shell (like <!-- language: lang-bash -->) rather than for AWK. (Google Prettify doesn't support AWK, but if you did have an actual AWK script, such as could be run with awk -f, then you could tell it to highlight it like C code and that would usually produce better results than no syntax highlighting. Anyway, that's a different situation.)
 
very good talk overall
what I'm not getting and what the documentation not really obviously explains is that weird construct {} END {} maybe i should give this whole documentation a thorough read
 
9:59 PM
AWK treats its input as a sequence of records, such that each record is a sequence of fields. The records are separated by the input record separator, which by default as a newline, and the fields are separated by the input field separator, which by default is whitespace. An AWK script consists mainly of rules of the form PATTERN { ACTION }. The pattern tests a record to determine if the action should be taken.
If you write a rule with no explicit pattern, it defaults to always matching--the action is taken for every record. If you write a rule with no explicit action, it defaults to printing the whole record. You cannot omit both because then you haven't written anything. In the rule {sum +=$1}, the pattern is omitted so the action is taken for each record. Since the default input record separator is an newline, this means the statements written in the { } get executed for every line of input.
BEGIN and END are special. When either appears in place of a pattern, the action is performed just once. Specifically, BEGIN { ACTION } performs the action before any input is read, and END { ACTION } performs the action after all the input is read and processed. When you see { ... } END { ... }, that's not a single construct, but two: an ordinary rule, just with its pattern omitted, implicitly matching every record; and a special END block whose action runs just once at the end.
 
ah ok, makes sense
 
10:30 PM
man, reading this causes me heart pain:
root@vps139242:~# sudo apt install --reinstall apache2 Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 48 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. E: Internal Error, No file name for apache2:amd64 Rhys19 22 mins ago
... and 48 not upgraded ... :(
and they wonder why things break
 

« first day (1976 days earlier)      last day (2360 days later) »