08-01-2006
One way is to actually truncate the file after you take the output. That way, you don't have to worry about the older contents at all. Or you could write a script to check the number of lines in the file when you actually take the output and then keep taking the output from that point on.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello!
I'm using a perl script which calls the time and
date from a remote server using the line
/bin/date -
What is needed in this line to
reduce the output time
5 hours?
Thanks (2 Replies)
Discussion started by: Texan
2 Replies
2. UNIX for Dummies Questions & Answers
tr "" "" | sort | awk 'length($0)>0' | uniq -c (1 Reply)
Discussion started by: brain_full
1 Replies
3. UNIX for Dummies Questions & Answers
I am trying to write a script that will remove any line in 2 given text files
starting with '-'.
the output should be to the second file.
this is what I tried:
#!/bin/csh -f
cat $1 $2 | grep -v '^-' > $2
the problem is the after executing the script, file2 contains only the
lines from... (7 Replies)
Discussion started by: stewie griffin
7 Replies
4. Shell Programming and Scripting
Every day a new .zip file is uploaded to a folder and at mid-night the zip file is to be extracted into a /data/ folder, inside a date-named folder.
# This should extract the contents of a zip file into the /data/ folder into a date based folder
/usr/bin/unzip -a -o... (15 Replies)
Discussion started by: worchyld
15 Replies
5. Shell Programming and Scripting
Hi Frens,
I want to list some files from a directory, which contains "DONE" in their name, i am receiving files every minute. In this i want to list all the files which are newer than 6 hours but older than 3 hours, of current time
i dont want my list to contain the latest files which are ... (4 Replies)
Discussion started by: Prat007
4 Replies
6. Shell Programming and Scripting
This is Input - starts with Storage Group Name and ends with Shareable and the loop continues all I need is Storage group name and Alu numbers in the below output format requested.
Storage Group Name: abcd
Storage Group UID: 00:00:000:00:0:0:0
HBA/SP Pairs:
HBA UID ... (6 Replies)
Discussion started by: maddysa
6 Replies
7. Shell Programming and Scripting
Hi Guys,
Good day! I hope you could help me on this, I have a file that conatins output upon executing cat /var/log/messages, then what I want is to get the logs that has been generated only starting from 24-hours earlier at the time of actual execution of the script. Is this possible?
Best... (9 Replies)
Discussion started by: rymnd_12345
9 Replies
8. Shell Programming and Scripting
Hi All,
Actually we want to know the command need to use if the difference between two files are null, then it should not send as mail. Oterwise it should send as mail alert.
Below for your reference,
# Email the spoolfile.
diff free_sp_new.log free_sp_old.log
if output of above... (1 Reply)
Discussion started by: thanvir.akram
1 Replies
9. Shell Programming and Scripting
been messing around with linux for a few months...not too good yet. thinking about taking a class or something, this #### is hard.......anyway, im trying to make an output file using the input from a prompt. heres basically what i have now (random example)
echo -n "Please enter your name: "
read... (7 Replies)
Discussion started by: rickbobb4444
7 Replies
10. UNIX for Dummies Questions & Answers
Hi all,
I am trying to loop through the string contents of an array, to add it during the saving of the output files. I am trying this code to print each column and save it to unique file name, but it doesn't work. Thanks for any help.
fnam=(japan usa uk)
alldata.dat contained sample data... (1 Reply)
Discussion started by: ida1215
1 Replies
LEARN ABOUT NETBSD
script
SCRIPT(1) BSD General Commands Manual SCRIPT(1)
NAME
script -- make typescript of terminal session
SYNOPSIS
script [-adfpqr] [-c command] [file]
DESCRIPTION
script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive
session as proof of an assignment, as the typescript file can be printed out later with lpr(1).
If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript.
Option:
-a Append the output to file or typescript, retaining the prior contents.
-c command
Run the named command instead of the shell. Useful for capturing the output of a program that behaves differently when associated
with a tty.
-d When playing back a session with the -p flag, don't sleep between records when playing back a timestamped session.
-f Flush output after each write. This is useful for watching the script output in real time.
-p Play back a session recorded with the -r flag in real time.
-q Be quiet, and don't output started and ended lines.
-r Record a session with input, output, and timestamping.
The script ends when the forked shell exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-d (if ignoreeof is not
set) for the C-shell, csh(1)).
Certain interactive commands, such as vi(1), create garbage in the typescript file. script works best with commands that do not manipulate
the screen, the results are meant to emulate a hardcopy terminal.
ENVIRONMENT
The following environment variable is used by script:
SHELL If the variable SHELL exists, the shell forked by script will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most
shells set this variable automatically).
SEE ALSO
csh(1) (for the history mechanism).
HISTORY
The script command appeared in 3.0BSD.
BUGS
script places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects.
BSD
October 17, 2009 BSD