04-16-2012
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers.
To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
Discussion started by: Ezy
2 Replies
2. Shell Programming and Scripting
Hi
I want to extract certain text between two line numbers like
23234234324 and
54446655567567
How do I do this with a simple sed or awk command?
Thank you.
---------- Post updated at 06:16 PM ---------- Previous update was at 05:55 PM ----------
found it:
sed -n '#1,#2p'... (1 Reply)
Discussion started by: return_user
1 Replies
3. Shell Programming and Scripting
using sed to replace a specific string on a specific line number using variables
this is where i am at
grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean
grep -n Destination... (2 Replies)
Discussion started by: todd.cutting
2 Replies
4. Shell Programming and Scripting
Hi guys ,
I m writing a script to delete a line at particular location.
But i m unable to use variable for specifying line number.
for example.
sed -n '7!p' filename
works fine and deletes 7th line from my file
but
sed -n '$variable!p' filename
gives following error.
sed: -e... (12 Replies)
Discussion started by: pinga123
12 Replies
5. Linux
Hello! All,
Could you please tell me how to get a specific line number from a text file?
For example below,
ABC
DEF ---> Get this line number, return to an variable
GHI
My OS is Linux.
Thank you so much for your help in advance! (3 Replies)
Discussion started by: barryxian
3 Replies
6. Shell Programming and Scripting
I have list of files in a directory 'dir'. Each file is of type HTML. I need to read each file and get the string which starts with 'http' and write them in a new text file. How can i do this shell scripting?
file1.html
<head>
<url>http://www.google.com</url>
</head>
file2.html
<head>... (6 Replies)
Discussion started by: vel4ever
6 Replies
7. Shell Programming and Scripting
Hello everyone,
I don't really know anything about scripting, but I have to manage to make this script, out of necessity.
#!/bin/bash
while read -r line; do #I'm reading from a big wordlist
instructions using $line
done
Is there a way to automatically write the $line number the script... (4 Replies)
Discussion started by: bobylapointe
4 Replies
8. Shell Programming and Scripting
Hi All,
I've a file like this..
Sheet1
a,1
a,2
a,3
a,4
a,5
Sheet2
a,6
a,7
a,8
a,9
a,10
Sheet3
a,11
a,12
a,13 (7 Replies)
Discussion started by: manab86
7 Replies
9. Shell Programming and Scripting
my requirement is,
consider a file output
cat output
blah sdjfhjkd jsdfhjksdh
sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf
hellow there
this doesnt look good
et cetc etc
etcetera
i want to replace a line of line number 4 ("this doesnt look good") with some other line
... (3 Replies)
Discussion started by: vivek d r
3 Replies
10. Shell Programming and Scripting
Hi guys,
I am running a while loop in a script ro read a file line by line.
Now I want to run a grep only on the lines below the line I am that is being read by the while loop.
Eg:
If my while loop is on line 4 of the file, the grep only runs below line 4 and does not include line 1,2... (3 Replies)
Discussion started by: Junaid Subhani
3 Replies
PARTY(1) General Commands Manual PARTY(1)
NAME
party - set OS responses mode
SYNOPSIS
party ON|OFF|WHEREIS [ - ] dnv
DESCRIPTION
Operating systems being what they are, the admin people can easily grow tired of command responses that resemble dyslexic eugene-
speak filtered through Kernighan and Ritchie's collective back-brains. To alleviate this, we have included a slightly more
`casual' mode, in which the responses to all commands are first filtered through a customising routine (DUDE) , which makes them
sound a little more friendly while retaining their full information content (usually). The rooted(c) system prompt is changed to
`What now, dude?' and output from each command is terminated by `No problem, dude.'
OPTIONS
-v Verbose mode (ALL commands have a `verbose' mode). When this option is present, all filtered responses are preceeded by a
message: `This response has been parsed by the DUDE filter and is not intended to be some sort of sleazy come-on.'
-d Don't restart all processes after recompiling the /uselss/libs/eugene file (see below). This alows any important tasks to
complete beforehand.
-n Notify all users that they are about to be force-logged out and force-logged in again.
ON Activates the DUDE filter.
OFF De-activates the DUDE filter.
WHEREIS
Doesn't do anything, but we couldn't resist it.
EXAMPLES
%-) party on
What now, dude?
To compare the differing responses, here is output provided by the ispi -s command, with party OFF and party ON:
party OFF
line who why how long
==========================================================
000 rooted that's you, dweeb! epoch
----------------------------------------------------------
00F wp she's supposed to be 0:44:12
typing up the end of
financial year report,
but she's been doing her
resume when she thinks
no-one is watching
----------------------------------------------------------
014 maint playing games, as usual 0:51:16
party ON
Well, let's see who's on, eh? There's you, of course, on line 000 (Imagine that! Hahaha!) Oh look, on serIOus line 00F, it's that
cute little secretary - looks like she's lost her keyboard template again, she's been hitting the escape key for the past five minutes!
AND OF COURSE, the guys down in maintenance are playing `cosmic ballcrushers'. As usual. Well, who else, um, no-one really
interesting like, ya know, oh hang on, DTR is toggling on serIOus line 03D.. oh, no problem, it's that stuffed modem again. You want
maybe I should send some AMail to maintenance and get 'em to look at it? No problem, dude.
What now, dude?
FILES
/uselss/libs/bill&ted/DUDE
This is the pipe process, usually
started at system shoe, which lies
idle until party ON is issued.
/uselss/libs/eugene
Contains all of the ordinary, ho-hum
confusing computer - jargonese
responses which commands ordinarily
issue. Text file.
/uselss/libs/eugene.spoo
compiled version of the eugene file.
/ephemeral/eugene.chex
Checksum for the compiled eugene file.
SEE ALSO
crp(1), stuffio(2), doobrie(9), gouge(3), ftang(65534), wi(-1), edmond(29), jumpstart(2), vo_mit(992)
BUGS
The -n option can be slow.
If the n option is issued, some users in a wi editing session may not receive the `warning, restart imminent' message until after the
restart.
There is no way selectively to follow symbolic links.
Sunburne Computer, Inc. 9 October 1991
Aug 18, 1997 PARTY(1)