11-30-2006
It is just me or does this look like an exam question?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
We have Multiple source files which has some data, I need a K shell script which will append number '1' as the last character to all the lines of the first file and then increments the value and appends '2' to all the lines to the next file and so on.
For Example
Incoming file 1
... (2 Replies)
Discussion started by: dsshishya
2 Replies
2. Shell Programming and Scripting
Hi,
I have a file like this...
<o t="Batch" id="8410" p="/" g="32">
<a n="name">
<v s="DBBA1MM"/>
</a>
<a n="owner">
<v r="/Administrator"/>
</a>
<a n="rights">
<v s="95"/>
</a>
<a n="debugLevel">
<v s="3"/>
</a>
<a n="avsStoreLoc">
<v... (8 Replies)
Discussion started by: kesu2k
8 Replies
3. UNIX for Dummies Questions & Answers
Right now, my code is:
s/Secondary Ins./Secondary Ins.\
1/g
It's adding a 1 as soon as it finds Secondary Ins.
Primary Ins.: MEDICARE B DMERC Secondary Ins.
1: CONTINENTAL LIFE INS
What I really want to achieve is having a 1 added on the next line that contain "Secondary Ins." It... (4 Replies)
Discussion started by: newbeee
4 Replies
4. Shell Programming and Scripting
Assume I have 2 gz files with 2 lines each as below
a.gz
a1,a
a2,a
b.gz
b1,b
b2,b
If I issue
gzip -d -c *.gz
I will get below in the stdout
a1,a
a2,a
b1,b
b2,b
What I need it the filename appended to each row either at the front or back.
a.gz,a1,a
a.gz,a2,a (2 Replies)
Discussion started by: ericlim
2 Replies
5. Shell Programming and Scripting
Hi,
I need to replace and append a string in a text if grep is true. For eg:
grep ABC test.txt | grep -v '\.$' | awk {'print $4'} | sed "s/ ?
How do I replace all instances of "print $4" using sed with another sring? Eg of the string returned will be,
lx123
web222
xyz
Want to... (8 Replies)
Discussion started by: vchee
8 Replies
6. Shell Programming and Scripting
I want to make a script to read row by row and find its length. If the length is less than my required length then i hav to append spaces to that paritucular row. Each row contains special characters, spaces, etc.
For example my file contains ,
12345 abcdef
234 abcde
89012 abcdefgh
... (10 Replies)
Discussion started by: Amrutha24
10 Replies
7. Shell Programming and Scripting
Hi ,
I have one file like
BUD,BDL BUDCAR
BUD,BDL BUDLAMP
ABC,CDF,KLT ABISKAR
ABC,CDF,KLT CORNEL
ABC,CDF,KLT KANNAD
JKL,HNM,KTY,KJY JAGAN
JKL,HNM,KTY,KJY HOUSE
JKL,HNM,KTY,KJY KATAK
JKL,HNM,KTY,KJY KOLKA
The o/p should be like
BUD,BDL BUDCAR,BUDLAMP
ABC,CDF,KLT... (4 Replies)
Discussion started by: jagdishrout
4 Replies
8. Shell Programming and Scripting
Hi ,
I have a file likeA-0044150|ABC/Frito/
A-0044150|GFHU
A-0150075|Bud Racing
A-0187811|Bud Light
A-0187811|RW&B signmaking
I Want the o/p likeA-0044150|ABC/Frito/,GFHU
A-0150075|Bud Racing
A-0187811|Bud Light,RW&B signmaking (2 Replies)
Discussion started by: jagdishrout
2 Replies
9. Shell Programming and Scripting
Hi All,
I'm trying to insert a string into a file at a specific location.
I'd like to add a string after the parent::__construct(); in my file.
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Controller extends CI_Controller {
function... (6 Replies)
Discussion started by: jjkilpatrick
6 Replies
10. UNIX for Beginners Questions & Answers
Hi Experts
Need help...
I am looking for a Unix script to append pipe | at the end of all the rows (except header and trailer)in all the files placed under the directory /interfaces/Temp
e.g.
Header
row1
row2
row3
Trailer
The script should read all the files under... (3 Replies)
Discussion started by: phani333
3 Replies
RESIZE(1) General Commands Manual RESIZE(1)
NAME
resize - set TERMCAP and terminal settings to current xterm window size
SYNOPSIS
resize [ -u | -c ] [ -s [ row col ] ]
DESCRIPTION
Resize prints a shell command for setting the TERM and TERMCAP environment variables to indicate the current size of xterm window from
which the command is run. For this output to take effect, resize must either be evaluated as part of the command line (usually done with a
shell alias or function) or else redirected to a file which can then be read in. From the C shell (usually known as /bin/csh), the follow-
ing alias could be defined in the user's .cshrc:
% alias rs 'set noglob; eval `resize`'
After resizing the window, the user would type:
% rs
Users of versions of the Bourne shell (usually known as /bin/sh) that don't have command functions will need to send the output to a tempo-
rary file and then read it back in with the "." command:
$ resize > /tmp/out
$ . /tmp/out
OPTIONS
The following options may be used with resize:
-u This option indicates that Bourne shell commands should be generated even if the user's current shell isn't /bin/sh.
-c This option indicates that C shell commands should be generated even if the user's current shell isn't /bin/csh.
-s [rows columns]
This option indicates that Sun console escape sequences will be used instead of the VT100-style xterm escape codes. If rows and
columns are given, resize will ask the xterm to resize itself. However, the window manager may choose to disallow the change.
Note that the Sun console escape sequences are recognized by XFree86 xterm and by dtterm. The resize program may be installed as
sunsize, which causes makes it assume the -s option.
The rows and columns arguments must appear last; though they are normally associated with the -s option, they are parsed sepa-
rately.
FILES
/etc/termcap for the base termcap entry to modify.
~/.cshrc user's alias for the command.
SEE ALSO
csh(1), tset(1), xterm(1)
AUTHORS
Mark Vandevoorde (MIT-Athena), Edward Moy (Berkeley)
Copyright (c) 1984, 1985 by X Consortium
See X() for a complete copyright notice.
X Window System RESIZE(1)