Sponsored Content
Top Forums Shell Programming and Scripting Putting screen output in a log file Post 302143666 by nsutti on Friday 2nd of November 2007 12:47:25 PM
Old 11-02-2007
unix script

This did not work, the program bombed out and put out my standard output. Not sure if this is valid for unix script. It did not like the scriptname.

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Getting command output and putting into newfile

Hello All, I am using the below code: #!/bin/sh /omp/bin/TICLI "op:alarm,all" > filename for getting command output and then putting the output into newfile but the problem is this, that not the complete output goes into newfile and the script stops. for example: if this commands gives... (18 Replies)
Discussion started by: wakhan
18 Replies

2. UNIX Desktop Questions & Answers

Output terminal sessions to screen and log file

I would like to use a terminal session to ssh to switches and routers. I need to capture data while logged into switches to a file I can email for troubleshooting. I use termial to log into Cisco switch, run the sh tech command, and then sent the output to cisco. Is there a way to run a... (4 Replies)
Discussion started by: tdelliott
4 Replies

3. UNIX for Dummies Questions & Answers

how to print script output to screen and file

Hi all, I have a script that bulk loads thousands of lines of data. I need to log the output during the execution of the script. I know I can redirect (">") the output to a file; however, I want the output going to both the screen and the log file. I thought I could use pipe to pipe the... (10 Replies)
Discussion started by: orahi001
10 Replies

4. Shell Programming and Scripting

Complete Screen Output to Log File

Hi, I would need to log the whole screen ouput to a log file. All Inputs from the Agent, all echo´s and DBMS Outputs from the PL/SQL. Basicly everything what I can see during the run on the screen. I tried it already with #exec 2>$BASELOG/RUN.log #exec 1>$BASELOG/RUN.log #exec >... (1 Reply)
Discussion started by: enjoy
1 Replies

5. Shell Programming and Scripting

putting color on output file script

do you have any simple script on how to change the color and font of a string in a script example echo "====================================" echo " sample color script" echo "====================================" echo " hello " echo " bye" on hello,... (3 Replies)
Discussion started by: lhareigh890
3 Replies

6. Shell Programming and Scripting

Redirect the output in a file and on screen

I am trying to get following result from the scipt I have. First time it generates the o/p in correct format. However if I run it again it appends to the existing file. I would like to see o/p on screen as well as save it in file. Everytime it should create new file. ## I/P file 0174 0175... (3 Replies)
Discussion started by: dynamax
3 Replies

7. UNIX for Dummies Questions & Answers

Putting the Current -date in the Output File

Hi guys, Just want to ask how can I make a script that will perform like this. 1. Execute the command 2. Then the output of the command will be redirected to a file 2. The file that has been created will have a date on it equivalent to the date and time it was created (or maybe after the... (5 Replies)
Discussion started by: rymnd_12345
5 Replies

8. Shell Programming and Scripting

Need help putting output on one line

Good afternoon, I have been searching the web, and these forums for help. I will try my best to explain the issue, and what my desired results are. I am doing queries in MYSQL, and need the output to be sent to a file. That file needs to have things with the same ID on the same line. To... (14 Replies)
Discussion started by: brianjb
14 Replies

9. Programming

No output screen when run from file manager

So I have ported a C++ program from windows to linux and when I run it from terminal all is well. However when executed from file manager there is no screen output. The program runs and does what it should, just the problem of not knowing if there are errors or if its even complete. Is there a... (12 Replies)
Discussion started by: pinbot
12 Replies

10. UNIX for Beginners Questions & Answers

Screen output to a file

Hi All, I am trying to out of shell script when i run it like sh /mypath/abc.sh ....a screen log should be generated whenever i input the values, when above the script prompt for values Regards Amarendra (3 Replies)
Discussion started by: amar1208
3 Replies
RUNSCRIPT(1)						      General Commands Manual						      RUNSCRIPT(1)

NAME
runscript - script interpreter for minicom SYNOPSIS
runscript scriptname [logfile [homedir]] DESCRIPTION
runscript is a simple script interpreter that can be called from within the minicom communications program to automate tasks like logging in to a unix system or your favorite bbs. INVOCATION
The program expects a script name and optionally a filename and the user's home directory as arguments, and it expects that it's input and output are connected to the "remote end", the system you are connecting to. All messages from runscript ment for the local screen are directed to the stderr output. All this is automatically taken care of if you run it from minicom. The logfile and home directory parame- ters are only used to tell the log command the name of the logfile and where to write it. If the homedir is omitted, runscript uses the directory found in the $HOME environment variable. If also the logfile name is omitted, the log commands are ignored. KEYWORDS
Runscript recognizes the following commands: expect send goto gosub return ! exit print set inc dec if timeout verbose sleep break call log OVERVIEW OF KEYWORDS
send <string> <string> is sent to the modem. It is followed by a ' '. <string> can be: - regular text, eg 'send hello' - text enclosed in quotes, eg 'send "hello world"' Within <string> the following sequences are recognized: - newline - carriage return a - bell  - backspace c - don't send the default ' '. f - formfeed o - send character o (o is an octal number) Also $(environment_variable) can be used, for example $(TERM). Minicom passes three special environment variables: $(LOGIN), which is the username, $(PASS), which is the password, as defined in the proper entry of the dialing directory, and $(TERMLIN) which is the number of actual terminal lines on your screen (that is, the statusline excluded). print <string> Prints <string> to the local screen. Default followed by ' '. See the description of 'send' above. label: Declares a label (with the name 'label') to use with goto or gosub. goto <label> Jump to another place in the program. gosub <label> Jumps to another place in the program. When the statement 'return' is encountered, control returns to the statement after the gosub. Gosub's can be nested. return Return from a gosub. ! <command> Runs a shell for you in which 'command' is executed. On return, the variable '$?' is set to the exit status of this command, so you can subsequently test it using 'if'. exit [value] Exit from "runscript" with an optional exit status. (default 1) set <variable> <value> Sets the value of <variable> (which is a single letter a-z) to the value <value>. If <variable> does not exist, it will be created. <value> can be a integer value or another variable. inc <variable> Increments the value of <variable> by one. dec <variable> Decrements the value of <variable> by one. if <value> <operator> <value> <statement> Conditional execution of <statement>. <operator> can be <, >, != or =. Eg, 'if a > 3 goto exitlabel'. timeout <value> Sets the global timeout. By default, 'runscript' will exit after 120 seconds. This can be changed with this command. Warning: this command acts differently within an 'expect' statement, but more about that later. verbose <on|off> By default, this is 'on'. That means that anything that is being read from the modem by 'runscript', gets echoed to the screen. This is so that you can see what 'runscript' is doing. sleep <value> Suspend execution for <value> seconds. expect expect { pattern [statement] pattern [statement] [timeout <value> [statement] ] .... } The most important command of all. Expect keeps reading from the input until it reads a pattern that matches one of the specified ones. If expect encounters an optional statement after that pattern, it will execute it. Otherwise the default is to just break out of the expect. 'pattern' is a string, just as in 'send' (see above). Normally, expect will timeout in 60 seconds and just exit, but this can be changed with the timeout command. break Break out of an 'expect' statement. This is normally only useful as argument to 'timeout' within an expect, because the default action of timeout is to exit immediately. call <scriptname> Transfers control to another scriptfile. When that scriptfile finishes without errors, the original script will continue. log <text> Write text to the logfile. NOTES
If you want to make your script to exit minicom (for example when you use minicom to dial up your ISP, and then start a ppp or slip session from a script), try the command "! killall -9 minicom" as the last script command. The -9 option should prevent minicom from hanging up the line and resetting the modem before exiting. Well, I don't think this is enough information to make you an experienced 'programmer' in 'runscript', but together with the examples it shouldn't be too hard to write some useful script files. Things will be easier if you have experience with BASIC. The minicom source code comes together with two example scripts, scriptdemo and unixlogin. Especially the last one is a good base to build on for your own scripts. BUGS
Runscript should be built in to minicom. AUTHOR
Miquel van Smoorenburg, <miquels@drinkel.ow.org> Jukka Lahtinen, <walker@clinet.fi> User's Manual $Date: 2000/02/10 10:28:00 $ RUNSCRIPT(1)
All times are GMT -4. The time now is 06:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy