How to substitute text from a line in bash - sed

I have txt file like this one:
Linux Mint 17
Ubuntu 14.04
Debian GNU/Linux 7.0
Mageia 4
Fedora 20
openSUSE 13.1
Arch Linux
CentOS 7.0-1406
PCLinuxOS 2014.07
Slackware Linux 14.1
FreeBSD
I need to take version numbers and put it to the beginning of a line.

Whit awk you can do some like this:
awk '$NF~/[0-9\.]+/ {f=$NF;$NF="";$0=f FS$0}1' file
17 Linux Mint
14.04 Ubuntu
7.0 Debian GNU/Linux
4 Mageia
20 Fedora
13.1 openSUSE
Arch Linux
7.0-1406 CentOS
2014.07 PCLinuxOS
14.1 Slackware Linux
FreeBSD
If last field contain any number, move it to front position.

Related

How to launch jconsole from Ubuntu 18.04 on Windows 10 WSL

I am trying to launch jconsole on Ubuntu 18.04 installed on WSL(Windows 10).
But it is just hanging there, like waiting for another input or argument.
/usr/lib/jvm/java-8-openjdk-amd64/bin$ ls -lrt jconsole
-rwxr-xr-x 1 root root 6336 Apr 16 02:48 jconsole
/usr/lib/jvm/java-8-openjdk-amd64/bin$ file jconsole
jconsole: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=ca8e0f8d1da13af7e272d6ac57781cab9d197b95, stripped
/usr/lib/jvm/java-8-openjdk-amd64/bin$ jconsole
<cursor blinking>
/usr/lib/jvm/java-8-openjdk-amd64/bin$ sudo jconsole
<cursor blinking>
Windows version:
C:\Users\username>ver
Microsoft Windows [Version 10.0.17763.1158]
Any help is appreciated, thanks!

Install swift 4 on bash on Ubuntu on Windows 10

I try to install Swift 4 on bash on Ubuntu on Windows 10
My version of Ubuntu:
me#DESKTOP:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
I did apt-get upgrade and apt-get update
I follow Linux steps here: to install Swift 4
Eventually I end up with the error:
me#DESKTOP:~$ swift
/home/me/swift4/swift-4.0.2-RELEASE-ubuntu16.04/usr/bin/lldb: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
I have python2 installed:
me#DESKTOP:~$ python2 --version
Python 2.7.12
I wonder how to make it works.
Installing libpython2.7 successfully resolves the error
$ apt-get install libpython2.7
However it still failed to launch the swift repl due to kernel permissions issue.
Using docker image (or Virtual Box like OP) is a better way to go.
reference
https://bugs.swift.org/browse/SR-2743

Installing iCub (Humanid) simulator on Linux mint 17

Can anybody tell me the procedure for installing iCub (humanoid) simulator on Linux mint 17 operating system. It seems they have only got the instruction procedure for Linux version of Debian and Ubuntu on their website.
Thanks
Lekan
Linux Mint 17 is derived from Ubuntu 14.04. So you can use the same installation procedure for the Ubuntu to Linux Mint. Steps for the same are given below.
Open terminal and enter the following command.
sudo sh -c 'echo "deb http://www.icub.org/ubuntu trusty contrib/science" > /etc/apt/sources.list.d/icub.list'
sudo apt-get update
sudo apt-get install icub
For more information follow the link iCub Installation procedure for Linux

OPEN: Fedora 22, 32 bit machine. Unable to install/build mysql-workbench

EDIT: See comments.
.I am unable to launch mysql-workbench on my Fedora 22 machine. It is installed, or at least it seems so. Help is welcome.
[root#localhost /]# dnf info mysql-community-bench
Nome : mysql-community-bench
[root#localhost /]# uname -a
Linux localhost.localdomain 4.1.3-201.fc22.i686+PAE #1 SMP Wed Jul 29 20:36:37 UTC 2015 i686 i686 i386 GNU/Linux
I don't see installed MySQL Workbench, what you installed is MySQL benchmark (not Workbench). You can grab your MySQL Workbench rpm package from https://dev.mysql.com/downloads/workbench/
What i have done to install mysql-workbench on my Fedora 22 (64 bits),
was to install required libraries before :
sudo dnf install -y ctemplate tinyxml vsqlite++ python-paramiko
Then i downloaded the mysql-workbench .rpm here : https://dev.mysql.com/downloads/workbench/
Fedora 22 (x86, 64-bit), RPM Package 6.3.4 17.4M
and finally installed successfully the package.
So maybe you could try instaling the Fedora 20 package after installing the required libraries above.

how to upgrade CentOS 5.11 to 6.x

I have tried executing yum update command but it only took me from 5.11 to 6.x. I need the server to be running CentOS 6.x for nagiosxi.
[root#nagiosxi network-scripts]# uname -a
Linux nagiosxi.inl.gov 2.6.18-371.8.1.el5 #1 SMP Thu Apr 24 18:23:07 EDT 2014 i686 i686 i386 GNU/Linux
As you probably know, CentOS is based on RedHat so the same rules apply for both.
In place upgrades between 4, 5, and 6 are not supported by RedHat (and thus CentOS). The only supported upgrade path is from 6 to 7. The expectation is that an upgrade path will continue in future releases.
With that said, there is a way to upgrade from 5 to 6 but it is not supported by RedHat so be careful with how you use it.
The link is: In place upgrade