02-10-2009
':>file' tells the shell to redirect the output of the NOOP command (which is none) to "file", creating it if it doesn't exist, or truncating it if it exists.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear All,
I have a comma-separated file.
1. The first line of the file(header) should have 4 commas(5 fields).
2. The last line of the file should have 1 comma(2 fields).
Pls help me in checking this condition in a shell script.
And the number of lines between the first line and last... (11 Replies)
Discussion started by: KrishnaSaran
11 Replies
2. Shell Programming and Scripting
Hi,
I am having a file which contains as below
Names(aaaa
,bbbb
,cccc
,dddd)
now i want the file to be updated with new value 'eeee' as below
Names(aaaa
,bbbb
,cccc
,dddd
,eeee)
Is there a way to script this ?
Thanks, (5 Replies)
Discussion started by: drams
5 Replies
3. Shell Programming and Scripting
Hi all,
I have searched and found various threads about removing spaces from a field within a text file. Unfortunately, I have not found exactly what I'm looking for, nor am I adept enough to modify what I've found into what I need.
I use the following command to remove the first line... (3 Replies)
Discussion started by: carriehoff
3 Replies
4. Shell Programming and Scripting
Hi, I am new in unix,
I just want to replace some values from text file according to column numbers. Like, I am having a table as given below:
val1 val2 val3 val4 val5
val6 val7 val8 val9
val10 val11 val12 val13
Now i want... (5 Replies)
Discussion started by: rish_max
5 Replies
5. Shell Programming and Scripting
Hello
Has anyone got an example shell script that I can use to compare the contents of two files.
The files should contain the same contents, eg.
file1.txt
apple
pear
grape
file2.txt
apple
pear
grape (2 Replies)
Discussion started by: deedaz
2 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I am trying to figure out how to copy the contents of a file to the clipboard, then paste into a command. i.e copy contents of file /path/filename.txt to <command> <paste text>
Hope that makes sense. Basically tryting to copy the text for use in a command without having to open the... (8 Replies)
Discussion started by: JCA70
8 Replies
7. Shell Programming and Scripting
Hi
I have a data file 'File2' consisting of 105670 lines. I want to copy and paste 17928 lines from 'File1' to 'File2' but I want to place it in between lines 21 and 17950 of 'File2'. How do I do it in awk?
For example-
File A has 5 lines
X
Y
1 2 3
4 5 6
7 8 9
and File B has
A
b... (1 Reply)
Discussion started by: ananyob
1 Replies
8. Shell Programming and Scripting
Hi
I have a data file 'File2' consisting of 105670 lines. I want to copy and paste 17928 lines from 'File1' to 'File2' but I want to place it in between lines 21 and 17950 of 'File2'. How do I do it in awk?
For example-
File A has 5 lines
X
Y
1 2 3
4 5 6
7 8 9
and File B has
A
b... (1 Reply)
Discussion started by: ananyob
1 Replies
9. Shell Programming and Scripting
Hello all,
I have a Kconfig file that looks like something below ...
================================
menu "Application type"
config GUI_TYPE_STANDARD
bool "Standard Application"
source "cfg/config/std.in"
source... (12 Replies)
Discussion started by: anand.shah
12 Replies
10. Shell Programming and Scripting
Shell script logic
Hi
I have 2 input files like with file 1 content as (file1)
"BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt
File 2 contents as fle(2)
"BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt
I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
LEARN ABOUT OPENDARWIN
script
SCRIPT(1) BSD General Commands Manual SCRIPT(1)
NAME
script -- make typescript of terminal session
SYNOPSIS
script [-a] [-k] [-q] [-t time] [file [command ...]]
DESCRIPTION
The script utility 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.
If the argument command ... is given, script will run the specified command with an optional argument vector instead of an interactive shell.
Options:
-a Append the output to file or typescript, retaining the prior contents.
-k Log keys sent to program as well as output.
-q Run in quiet mode, omit the start and stop status messages.
-t time Specify time interval between flushing script output file. A value of 0 causes script to flush for every character I/O event. The
default interval is 30 seconds.
The script ends when the forked shell (or command) 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. The script utility works best with commands that do not
manipulate the screen. The results are meant to emulate a hardcopy terminal, not an addressable one.
ENVIRONMENT
The following environment variable is utilized 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
The script utility places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects.
It is not possible to specify a command without also naming the script file because of argument parsing compatibility issues.
When running in -k mode, echo cancelling is far from ideal. The slave terminal mode is checked for ECHO mode to check when to avoid manual
echo logging. This does not work when in a raw mode where the program being run is doing manual echo.
BSD
June 6, 1993 BSD