You are not logged in.

#1 2010-12-11 14:26:05

matnik
Member
From: Kraków, Poland
Registered: 2010-11-19
Posts: 8

BASH(1)saving additional output to the file?,(2) kdialog colored text?

Hello.
I've got two questions.
I'll start with the simpler ones.

1. Is there any possibility to run a notification in KDE (I tried to do it with kdialog, but with my current knowledge I couldn't do it) with colored text? I mean f.e. An info line. Below a green line with success message or red with failure message. All in one notification window.

If there is, than how? smile

2. I am writing a bash script which will be testing my web application. From the inside of a script I'd like to run a bash command, so the output will be printed in the terminal, but I would also like to print the output to the f.i. application_output.out file.

It might be a lil' bit unclear, so I'll give an example.
When from the inside of my bash script I would write:

#!/bin/bash
date

Then the result would be:

Sat Dec 11 15:22:23 CET 2010

But when I have such script:

#!/bin/bash
date > output.out

The output will be printed to the file.

And my aim is to achieve both outcomes using only one date command.
Any help?

Offline

#2 2010-12-11 16:12:07

modulation
Member
Registered: 2010-02-27
Posts: 6

Re: BASH(1)saving additional output to the file?,(2) kdialog colored text?

For the second question you could use 'tee' to write to stdout and a file

date | tee output.out

Offline

Board footer

Powered by FluxBB