Sometimes, in file1, it is possible that one value in column 1 is associated to 2 or more values like this:
Now, when I need to replace and copy as described in my other post, I need to do this for each value associated with a1.
The problem is, I tried with multidimensional arrays and other stuffs, but it doesn't write the full 9 lines for the 2nd value (c1 or c3).
Is there a way to jump back 10 lines up and retest the same line so I can process it again for the 2nd and 3rd value? I've searched since last post and can't find somethinbg working...
Thanks again and again !
Here is the code I use ...
And here is the ouput I have
Hi,
i am using SuonOS and ksh.
i need to add data into a file(s.txt) using a shell script. i have to pass 3 parameters and these 3 paramaters should add into the file at end of the file.
File s.txt is look like,
---------------------------------
column1|column2|column3
... (1 Reply)
Hi
I want to grep for a line and copy and paste that line.
for Example
---- file abc.txt ----
host=atlx1 sid=atld1 mail=abc@abc.com
host=atlx2 sid=atld2 mail=xyz@abc.com
host=atlx3 sid=atld3 mail=def@abc.com
host=atlx4 sid=atld4 mail=mno@abc.com
--- end of file abc.txt ----
Now I... (16 Replies)
Dear Friends,
I am beginner in Perl and trying to find the problem in a script. Kindly help me to modify the script. My script is not giving the output for the last field and followed text (LA: Language English). Input file & script as follows:
Input file:
Thu Mar 19 2:34:14 EDT 2009
STC... (3 Replies)
Hi,
I want to copy some files from a Folder say, /usr/X at random intervals to another location.
Basically, new files will be dumped at random intervals to location /usr/X and I have to copy those new files to some other location (after copying, I cannot delete those files from source... (2 Replies)
Dear all,
I have a database with thousands of files with the structure of name is:
Filename_hour_year.abc
Filename_hour_year_1.abc
..............
So what I need is how to write a script that all file with contain the character "_1" will copy to "_2"
For example: file name:... (7 Replies)
I need to read data from a file called "test.csv" through shell script where the file contains values like name,price,descriptor etc. There are rows where descriptor (& in some rows name) are written as string & other characters like "car_+" OR "bike*" etc where it should contains strings like... (3 Replies)
Hi,
I have a text file which is following format -
COL VAL
ABC 1
ABC 2
ABC 3
ABC 4
ABC 5
My requirement is to search for a particular value (provided by user) in the file and comment the previous entries including that as well.
E.g. If I search for number 3, then the output... (6 Replies)
Hi,
I want a script shell to automate modifying httpd.conf file for
several instances of apache, save httpd.file before changing it, after
modifying it and then restart apache.
- Replace ServerRoot "xxxx" by ServerRoot "yyyy" of all directories :
"... (4 Replies)
Hi there,
I have built up my own little "cloud" for my family as the amount of computers grows all day. By now we use 3 smartphones, 2 notebooks und 4 PCs, so this "home cloud" was made to store all personal data (photos, documents,...) and do a backup once in a while. It is running on a Ubuntu... (1 Reply)
I wish to take a backup of the file when someone tries to modify a file say /tmp/test.txt using vi, vim, cat, copy, mv commands.
I'm aware of inotify which will notify me of any changes to the file however, I wish to make a backup before and not after the changes are made to the file.
I... (1 Reply)
Discussion started by: mohtashims
1 Replies
LEARN ABOUT HPUX
script
script(1) General Commands Manual script(1)NAME
script - make typescript of terminal session
SYNOPSIS
[file]
DESCRIPTION
makes a typescript of everything printed on your terminal. It starts a shell named by the environment variable, or by default and silently
records a copy of output to your terminal from that shell or its descendents, using a pseudo-terminal device (see pty(7)).
All output is written to file, or appended to file if the option is given. If no file name is given, the output is saved in a file named
The recording can be sent to a line printer later with lp(1), or reviewed safely with the option of cat(1).
The recording ends when the forked shell exits (or the user ends the session by typing "exit") or the shell and all its descendents close
the pseudo-terminal device.
This program is useful when operating a CRT display and a hard-copy record of the dialog is desired. It can also be used for a simple form
of session auditing.
respects the convention for login shells as described in su(1), sh(1), and ksh(1). Thus, if it is invoked with a command name beginning
with a hyphen (that is, passes a basename to the shell that is also preceded by a hyphen.
The input flow control can be enabled by setting environmental variable before running Please see section for details on using this envi-
ronment variable.
EXAMPLES
Save everything printed on the user's screen into file
Append a copy of everything printed to the user's screen to file
WARNINGS
A command such as which displays the contents of the destination file, should not be issued while executing because it would cause to log
the output of the command to itself until all available disk space is filled. Other commands, such as more(1), can cause the same problem
but to a lesser degree.
records all received output in the file, including typing errors, backspaces, and cursor motions. Note that it does not record typed char-
acters; only echoed characters. Thus passwords are not recorded in the file. Responses other than simple echoes (such as output from
screen-oriented editors and command editing) are recorded as they appeared in the original session.
When there is no input flow control is not set), there can be some data loss while using However, script(1) can behave unexpectedly, if is
set and is not set.
AUTHOR
was developed by the University of California, Berkeley and HP.
script(1)