Search Results

Search: Posts Made By: prasanna1157
2,788
Posted By prasanna1157
Thanks Jim. I would like to read...
Thanks Jim.

I would like to read interactively from the shell in the middle of the script.

The shell should wait for the user to enter multiple lines, read and store it in a variable rather...
2,788
Posted By prasanna1157
Reading Standard Input
Hello,
I am new to scripting.

How do I read multiple lines from the command line?

I know read reads one line, but if I have to read multiple lines, how should I do?


Thanks,...
2,623
Posted By prasanna1157
System Variables
Is there something called system variables in Unix?

Can someone list a few of them?

Does it include variables like HOME, TERM, PWD etc.?
6,873
Posted By prasanna1157
Yes, first is \1. Thanks.
Yes, first is \1.

Thanks.
6,873
Posted By prasanna1157
If we have \(a\(b\)\) Which is \1, which is...
If we have \(a\(b\)\)

Which is \1, which is \2?
6,873
Posted By prasanna1157
grep backreferencing question
To be clear:

int a123,b,c; --- legal
int 12a,b; ---- illegal since the variable starts with a number
int A,b,c ---- illegal since the variable starts with [A-Z]


A few valid...
6,873
Posted By prasanna1157
Thanks. ---------- Post updated at 02:59 PM...
Thanks.

---------- Post updated at 02:59 PM ---------- Previous update was at 02:56 PM ----------



Oh, sorry. Yes, I did not state it initially.

One more question, the .* makes it match...
6,873
Posted By prasanna1157
It works even if I remove all the \<\> from the...
It works even if I remove all the \<\> from the above code. Can you explain how?
6,873
Posted By prasanna1157
grep backreferencing question
>>>> Thanks lot. The only problem with the above is, it matches illegal declarations also.

like, int a,b,,b; int a,b,b,;

---------- Post updated at 02:20 PM ---------- Previous update was at...
6,873
Posted By prasanna1157
grep backreferencing question
Hello,
My input would be :
###Anything
int b,c,a;
int a,b,b;
###Anything
int c,d,c;
int k,l;
###ANYTHING

Many declarations interspersed with other statements. I am trying...
1,864
Posted By prasanna1157
awk script - reading input lines
Can I do something like,


if($0==/^int.*$/) {

print "Declaration"

}

for an input like: int a=5;

If the syntax is right, it is not working for me, but I am not sure about the syntax....
13,176
Posted By prasanna1157
Thanks a lot.
Thanks a lot.
13,176
Posted By prasanna1157
Thanks a lot. Is the regex not greedy? Would...
Thanks a lot.

Is the regex not greedy? Would it not match the last </table> that it sees, if there are other table tags below our </table>


Thanks,
Prasanna
13,176
Posted By prasanna1157
sed to parse html
Hello,
I have a html file like this :

<html>
...
...
...
<table>
.......
......
</table>
<table name = "hi">
......
.....
...
</table>
<h1> Welcome </h1>
...
4,753
Posted By prasanna1157
Thanks a lot for your reply. Yes, I got to...
Thanks a lot for your reply.

Yes, I got to that too. But I would want to match any variable(not only the first), if it occurs more than once.

Thanks,
Prasanna
6
awk
1,214
Posted By prasanna1157
Thanks for the replies. My desired output is...
Thanks for the replies.

My desired output is :

1
2
3
4
5
9


Thanks,
Prasanna
4,753
Posted By prasanna1157
Print lines where variables occur more than once using grep
Hello,
I want to only print lines where variables occur more than once using grep.

For eg:

Input:
$this is a comment
int a,b,c,b;
int b,c;
int d,e;
int f,g,f;
x=y+5;

For the...
6
awk
1,214
Posted By prasanna1157
awk
Hello,
Is there a way to print only unique lines in awk?

Suppose I have to print :
1,2,3
3,4,5
9,3

I have to print all the numbers only once. Is there a way to print uniquely using...
3
awk
1,129
Posted By prasanna1157
I tried to use space as the delimiter, and then...
I tried to use space as the delimiter, and then take out $1, and $2. Didn't work.

For printing on different lines, I think I could use the NF, and then print a new line. But I don't know how to...
3
awk
1,129
Posted By prasanna1157
awk
Hello,
I have an input like :

int a,b,c,a;
int d,e,a;
int f,d;


Note the ";" at the end of the line, and the spaces before and after the "int". There could be multiple...
2,057
Posted By prasanna1157
grep question
Hello,
Is there a way in grep to remember patterns?

For eg: int a,b,c,d,a;

If a variable is declared twice, like in the previous example, I should be able to print only those lines....
1,721
Posted By prasanna1157
Thanks for the post. No, I am just exploring...
Thanks for the post.

No, I am just exploring the options only in find.

There should be a way to do it only using fin?
1,721
Posted By prasanna1157
Yes thanks, but I am trying if I could do that...
Yes thanks, but I am trying if I could do that only using find and its options.

Can you think of anyway?

---------- Post updated at 02:50 PM ---------- Previous update was at 02:34 PM...
1,721
Posted By prasanna1157
Not using regular expressions?
Not using regular expressions?
1,721
Posted By prasanna1157
find command
Hello,
I am doing something like this:

find "dir" -type f

I want my find to return only files that begin with a number!

Is there a way to do this, using the -name option or...
Showing results 1 to 25 of 44

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