Search Results

Search: Posts Made By: sunrexstar
30,206
Posted By sunrexstar
Thanks folks. My bad. i dint try it. it works...
Thanks folks.
My bad. i dint try it. it works :)

Thanks a lot.
30,206
Posted By sunrexstar
Thanks. The '&' will put the job in background....
Thanks.
The '&' will put the job in background. but it does not move to the next command to execute until the existing job is complete.
so, in my case, the rm command will still wait until the job...
30,206
Posted By sunrexstar
Executing two commands in parallel
Hi,
I am stuck into a situation where i want to execute a command in my shell script well along with a previous command in order to achieve something but i am not figuring out a way.
here is a...
8,669
Posted By sunrexstar
I am using Red hat linux with a bash shell. By...
I am using Red hat linux with a bash shell.
By the way. thanks i was missing that thing and you pointed it out right.
thanks again.
8,669
Posted By sunrexstar
assign value to array variable
Hi,
I have a piece of code as follows:

i=0
while read LINE
do
var[i] = "$LINE"
i=$((i+1))
echo "${var[i]}"
done < file

I want to assign value to the array var[i].
However, when...
5,915
Posted By sunrexstar
I am actually trying to gather the values and...
I am actually trying to gather the values and store them in variables.
Here each line is a value that the user will provide via the file.
so each line is something that has to be stored as a...
5,915
Posted By sunrexstar
reading line by line from a text file
Hi,
I have a text file something like this:
10.10.10.1,
ldap,
cn=users,dc=example,dc=com
.....
...
and many more lines
...
...

now i want to read each individual line from the file and...
6,882
Posted By sunrexstar
deleting lines between patterns using sed or awk
hi,
Here is excerpt from my xml file


<!-- The custom module to do the authentication for LDAP
-->

</login-module>
<login-module...
2,164
Posted By sunrexstar
inserting multiple lines with awk
awk '/<login-module code="com.nlayers.seneca.security.LdapLogin" flag="sufficient">/{p++} /<login-module code="com.nlayers.seneca.security.LdapLogin" flag="sufficient">/ && p==1 {$0="Mulitple lines...
4,013
Posted By sunrexstar
unary operator expected
i=0
while [ $i -le $buf ]

Shell script reports an error "unary operator expected" pointing the above line.
$i by default is 0 and holds integer value and $buf is also holding integer value.
...
20,541
Posted By sunrexstar
I tried but it is doing the job of replacing...
I tried but it is doing the job of replacing rather than inserting a line before the pattern.

---------- Post updated at 03:35 AM ---------- Previous update was at 03:34 AM ----------




...
20,541
Posted By sunrexstar
Looks like only awk can help me in this scenario....
Looks like only awk can help me in this scenario.
This helped me. now i would like to have some text written before the pattern.
Well, please can you tell me the syntax to write the text before the...
20,541
Posted By sunrexstar
sed appending needed only after first instance
Hi,
Here is my piece of code used with sed in shell script:
sed -i '/<falsemodule-option>/ a\<LdapLogin>' myxmlfile

The problem that i am facing with the above is that in 'myxml' file i have...
4,034
Posted By sunrexstar
if [$connect == "n" -o $connect == "N" -o...
if [$connect == "n" -o $connect == "N" -o $connect == "no" -o $connect == "No" -o $connect == "NO"]
then

echo "i am in N"

else
echo "i am in Y"

fi

Please use code tags...
4,034
Posted By sunrexstar
Thanks folks. It helped me. One last question...
Thanks folks.
It helped me.
One last question in the same context.
Can i have multiple condition checks in the same IF.
example:

if [ cond1 -o cond2 -o cond3 -o cond4 ......]

I tried the...
4,034
Posted By sunrexstar
or in a IF condition
Hi
I have to evaluate multiple conditions with an 'or'.

Here is an example:

if [ $connect == "n" || $connect == "N" ]

when i use the above i get a error message
[: missing `]'

Please...
3,227
Posted By sunrexstar
choose y or n
Hi,
I have written a choice based shell script some thing like this:

if (y)
execute code
....
fi

else if(n)
terminating


the problem with the above scripting is it will work as far as...
3,852
Posted By sunrexstar
thanks. I used the same but That din't work.
thanks.
I used the same but That din't work.
3,852
Posted By sunrexstar
using sed in shell script
Hi,
i want to replace sub text which is in the middle of long text.

let me be more clear with an example.

Here is the actual text in the xml file

<module-option...
1,582
Posted By sunrexstar
thanks a lot. i will try this out.
thanks a lot. i will try this out.
1,582
Posted By sunrexstar
Here is the example. Below lines in the xml...
Here is the example.
Below lines in the xml file start at line number 35 to 40.
I want to replace the 1.1.1.1 with another ip (provided by the user) and also the port number 389 with another port...
1,582
Posted By sunrexstar
thanks a lot. I would also want to replace the...
thanks a lot.
I would also want to replace the same text at line 35 to 40.
What i mean is there is already text between lines 45 to 50 and i want to replace that text.
Please cna you let me know...
1,582
Posted By sunrexstar
input text at certain lines of a file
Hi,
I have an xml file which will be edited by the user.
I would like to get input from user and insert that at line 40 of the xml file.
PLease can some one help me to know how to insert the text...
31,584
Posted By sunrexstar
call another shell script and pass parameters to that shell script
Hi,
I basically have 2 shell scripts.
One is a shell script will get the variable value from the user. The variable is nothing but the IP of the remote system.
Another shell script is a script...
3,793
Posted By sunrexstar
Thanks ilikecows for a very useful solution. ...
Thanks ilikecows for a very useful solution.
For a moment i thought this would be the best solution that you provided.
However, i can see another problem.
The problem is that this script connects...
Showing results 1 to 25 of 30

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