LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-29-2005, 01:54 PM   #1
yoderp
LQ Newbie
 
Registered: Jun 2005
Posts: 6

Rep: Reputation: 0
Script question


What is a simple BASH script command to copy the contents of the Konsole screen to a log file as the information is being display?

display info to script.log

I have tried the > script.log ,which created the log file, but no information is added to the log.
 
Old 06-29-2005, 02:28 PM   #2
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Perhaps try "script filename", exit with ctrl-d

Hmm, I think I misunderstood the question, try this: http://en.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html

Last edited by makuyl; 06-29-2005 at 02:32 PM.
 
Old 07-05-2005, 02:02 PM   #3
yoderp
LQ Newbie
 
Registered: Jun 2005
Posts: 6

Original Poster
Rep: Reputation: 0
Ok I have had time to try all of the following commands:

grep da * 2> log.txt
grep da * 1>&2 >log.txt
grep * 2>&1 >log.txt

all of these commands will create some type of log, but not what I am looking for. I am trying to have all of the information displayed on the konsole screen out puted to a log file as a script is run. Including the information in the script and the commands output responce. I need all of the following to be writen to a log file:

-------------------------------------------------------------------------------------------------
sample script X_umount.sh
-------------------------------------------------------------------------------------------------

umount: /dev/fd0
umount: /dev/scd0
umount: /dev/sda1
umount: /dev/hda8
umount: /dev/hda10
umount: /dev/hda11
echo "The following devices have been umounted in /test ..... floppy,cdrom,usb,D2,D3,D4,D5,D6,D7 "

-------------------------------------------------------------------------------------------------
resulting konsole screen output
-------------------------------------------------------------------------------------------------
root@localhost root]# ./X_umount.sh

umount: /dev/fd0: not mounted
umount: /dev/scd0: not mounted
umount: /dev/sda1: not found
umount: /usr: device is busy
umount: /var: device is busy
umount: /dev/hda8: not mounted
umount: /tmp: device is busy
umount: /dev/hda10: not mounted
umount: /dev/hda11: not mounted
The following devices have been umounted in /test ..... floppy,cdrom,usb,D2,D3,D4,D5,D6,D7,

[root@localhost root]#
--------------------------------------------------------------------------------------------
 
Old 07-05-2005, 02:24 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
makuyl's idea of using script should work for you.
 
Old 07-05-2005, 02:48 PM   #5
yoderp
LQ Newbie
 
Registered: Jun 2005
Posts: 6

Original Poster
Rep: Reputation: 0
OK I tried the command

rm -rf /

The command did write the information I needed to a log file, but also delete some system files. Good thing I tried this only on a test unit. Once I get the system back up and running I will try just -rf /
 
Old 07-05-2005, 03:07 PM   #6
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
The "rm -rf /" part is his signature and is a joke. I suggest you don't try it again.
 
Old 07-06-2005, 06:22 AM   #7
heema
Senior Member
 
Registered: Sep 2003
Location: Egypt
Distribution: Arch
Posts: 1,528

Rep: Reputation: 47
Noooooooo , dont use that command as it will delete everything in ur system

Last edited by heema; 07-06-2005 at 06:23 AM.
 
Old 07-06-2005, 07:17 AM   #8
yoderp
LQ Newbie
 
Registered: Jun 2005
Posts: 6

Original Poster
Rep: Reputation: 0
ok thanks. I will not use the command.
 
Old 07-06-2005, 08:57 AM   #9
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
Quote:
Originally posted by yoderp
OK I tried the command

rm -rf /

The command did write the information I needed to a log file, but also delete some system files. Good thing I tried this only on a test unit. Once I get the system back up and running I will try just -rf /
You can't possibly be serious....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
script question therealbxp Programming 5 08-07-2005 04:28 AM
Script Question easyE Linux - General 2 04-03-2005 11:34 AM
Script Question blubbfish Linux - Newbie 2 04-26-2004 04:18 AM
script question shanenin Linux - Software 2 04-04-2004 10:39 AM
some script-question G.P.P. Linux - Newbie 3 01-11-2003 05:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration