Please note that LinuxExchange will be shutting down on December 31st, 2016. Visit this thread for additional information and to provide feedback.

I use an embedded terminal (Tilda) full time on my desktop, as I connect to my network of Ubuntu machines mainly thru SSH. I set up an update notification script that tells me update staus remotely, but it's kind o' clunky (I know my scripting skills are far from pro). Here's what I set up:

Create a folder ~/.updates.
Create script called updates as follows:

#!/bin/bash
# cat updates
# A script to print out update status in bash
#
sudo apt-get update > ~/.updates/updates.log
sudo apt-get -s dist-upgrade >> ~/.updates/updates.log
cat ~/.updates/updates.log | grep upgraded,

This does the job, but I'm sure it's far from optimal. Anyone have any suggestions on how to get it tightened up? This sort of thing is easy to do in some distros (Arch comes to mind), but Ubuntu is designed more for things like Update Manager and other graphical tools, so this was the best I could come up with so far. I want to be able to just get the line for available updates (for use in other scripts), not all the associated printout.

asked 07 Sep '10, 11:03

Dean%20Clemmons's gravatar image

Dean Clemmons
112
accept rate: 0%




Well you do have a useless use of cat on the last line.

You can do without updates.log file (but maybe you want it, it's not clear what your goal is here):

sudo apt-get update | grep upgraded,
sudo apt-get -s dist-upgrade | grep upgraded,
link

answered 17 Sep '10, 13:31

npostavs's gravatar image

npostavs
963
accept rate: 42%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×81
×9

Asked: 07 Sep '10, 11:03

Seen: 1,335 times

Last updated: 18 Mar '11, 22:22

powered by OSQA