Search Results

Search: Posts Made By: orno
3,910
Posted By orno
Parse a file to display lines containing a word
Hi!

I'm trying to create a shell script to parse a file which might have multiple lines matching a pattern (i.e. containing some word).
I need to return all lines matching the pattern, but...
2,264
Posted By orno
That's perfect What if I want to append the...
That's perfect

What if I want to append the variable ONLY on the the line 2 lines after the line found with the string SEPARATOR?

i.e. Output should be
2,264
Posted By orno
Append variable to only certain lines
Hi There!
I'm trying to write a shell script which generates a random hexadecimal number and then appends it to the end of lines XX onwards of a certain file. XX is determined by a certain string on...
17,349
Posted By orno
its up there in my first post, as well as here...
its up there in my first post, as well as here below now :)

#!/bin/sh

params=$*
PROMPT_COMMAND='echo -ne "\033]0; $params \007"'

have fun!
3,257
Posted By orno
How silly! thanks for the correct solution!
How silly!

thanks for the correct solution!
39,882
Posted By orno
wow! so many answers, which one to choose? :) ...
wow! so many answers, which one to choose? :)

just another question though...when I have the choice of solving something like this using awk or sed, which one should i choose and why? is on better...
3,257
Posted By orno
sed: working with multiple lines
Got another sed question :)

My text block is


I need to do the following:
If (and only if) the line starting with 10002,11 is followed by a line starting with 10004,9 , insert the line...
62,961
Posted By orno
Delete lines starting with XX or YY or ZZ or ....
Hi There!

My final task for today is to delete lines starting with certain numbers

for e.g., my text block is


and i want to delete all lines starting with 11 or 17 or 21

I know i can...
2,583
Posted By orno
thanks guys! both solutions work perfectly,...
thanks guys!
both solutions work perfectly, although i think i'll use radoulov's coz its quite quite fast in comparison :)

cheers!
2,583
Posted By orno
String manipulation
Hi There!

I have the following block of text in my input file




and in order to parse it correctly, i need to have



i.e. If a line starts with a number, ignore it else replace it with...
39,882
Posted By orno
indeed quite difficult to understand! could...
indeed quite difficult to understand!

could you explain what's happening there?


EDIT: didn't see yogesh had already replied...all makes sense now, thanks guys!!!
39,882
Posted By orno
Using sed to delete string between delimiters
Hi There!
I have the following string



which i need to convert to



i.e. between each occurence of the delimiter ('|' in this case), i need to delete all characters from the '|' to the...
2,693
Posted By orno
perfect...thanks for the quick reply jim!
perfect...thanks for the quick reply jim!
2,693
Posted By orno
Which is faster? Reading from file or 'ps'
Hi There...
I have an application which starts up many different processes under different names and I'm creating a script to tell me which processes are running (approx 30 different processes). To...
30,686
Posted By orno
thanks for all the replies guys...they all work...
thanks for all the replies guys...they all work fine :D

now i just have to figure out which one i want to use :p
30,686
Posted By orno
Getting process ID using PS
Hello again
My problem today is somewhat silly:

I have 2 running processes: lamb and lambda (which i unfortunately cant rename). I need to get the process ID alone of both of them using only ps
...
8,909
Posted By orno
Since I'm feeling nice, here's a translation: ...
Since I'm feeling nice, here's a translation:

Hi, I'm just starting to find my way around the UNIX world and now have the following problem, I hope you guys can help (its most probably trivial for...
1,831
Posted By orno
File contents parsing
Suppose I have a file which has either the contents
CALLED on <date & time>
RUNNING on <date & time>or
CALLED on <date & time>
RUNNING on <date & time>
SHUTTING_DOWN on <date & time>
DOWN on...
17,349
Posted By orno
brilliant :) i should have read the Bash...
brilliant :)

i should have read the Bash basics before starting off :P

Thanks!
17,349
Posted By orno
Renaming putty windows with a shell script
i frequently have to open multiple putty windows to ssh into a unix server running HP-UX 11.23. Since i use some of the windows for dedicated processes i would like to rename them (the caption...
Showing results 1 to 20 of 20

 
All times are GMT -4. The time now is 04:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy