Search Results

Search: Posts Made By: InduInduIndu
5,759
Posted By InduInduIndu
problem with rsh in bash shell
Hello All,

I am trying to gather output of df -k from remote server to local server using below line:

rsh <host> df -k >/tmp/space_remote_host.txt


Why above throws following error...
3,559
Posted By InduInduIndu
Case1: cat /tmp/data_rank | awk -F ',' ' {print...
Case1: cat /tmp/data_rank | awk -F ',' ' {print $9 $1}'
Case2: cat /tmp/data_rank | awk -F ',' ' {print $10 $1}'
Case3: cat /tmp/data_rank | awk -F ',' ' {print $1 $10}'

Case1 & Case3 works...
3,559
Posted By InduInduIndu
Problem with awk double digit fields
Hello Everyone,
This 10th field is giving too much problem in AWK. How do i overcome ? pls suggest Thanks!


cat /tmp/data_rank| awk 'BEGIN{
print "HT No" "," "Name" "," "Maths" "," ...
1,742
Posted By InduInduIndu
Thanks a lot it was very much helpful.
Thanks a lot it was very much helpful.
1,373
Posted By InduInduIndu
Help needed with awk external variable
I'm trying to get the universities result data into different file, where the $9 contains unversity field and field7,4 & 5 contains the keys to sort the students by marks. How to use uni variable to...
1,742
Posted By InduInduIndu
Array comparision in bash shell
I'm not sure if i can put the problem in understandable form.Let me try:


I have a array which is like and always fixed:
Array1=(new inprogress pending Restored Resolved )

Other 2 array...
1,542
Posted By InduInduIndu
i=1 for id `cat <file>| sed -n 's/^Queue...
i=1
for id `cat <file>| sed -n 's/^Queue \[([A-Z]\+)\].*/\1/'`
do
arr[$i]=$id
i=`expr $i + 1`
done
i=1
size=${arr[@]}
while [ $i -lt $size ]
do
j=`expr $i + 1`
sed -n "/Queue...
19,115
Posted By InduInduIndu
Regex - Return numbers of exactly 8 digits
You are right!

However, i dont understand why people go for awk, nawk, when simple things like grep works.

I simply follow this:
1. Can it be done by Basic Regex? => yes, go for grep & sed...
32,736
Posted By InduInduIndu
Really Sorry RodiC i couldn't exactly copy pasted...
Really Sorry RodiC i couldn't exactly copy pasted my script here coz the script lies in the system where this site is blocked. I'd need to make hell lot of effort to exactly copy paste code. So i...
19,115
Posted By InduInduIndu
All of the above solution looks perfectly good, i...
All of the above solution looks perfectly good, i really don't know whats going on in your system.
You may try like this also:

grep -Ew '\"[0-9]{8}\"' <file>| sed 's/''//g'
32,736
Posted By InduInduIndu
Hi Rodic, This is the excat thing i was doing: ...
Hi Rodic,
This is the excat thing i was doing:

problem_arr=`grep -E -o "PRB[0-9]{1,4}" problemid.txt`
j=1
while [ $j -le ${problem_arr[@]} ]
do
k=`expr $j + 1`
sed -n...
1,022
Posted By InduInduIndu
Please post the content of the $1 file. If my...
Please post the content of the $1 file. If my guess is correct then instead of merely providing the output file name, u may have to give /<dir>/<filename>.
32,736
Posted By InduInduIndu
sed: -e expression #1, char 0: no previous regular expression
Hello RodiC & Alister,
Im using bash. My code is now running fine with no error.
1. I first tried to assign the elements manually like:

i=1
while [ $i -lt ${#arr$} ]
do
arr[$i]=element(comes...
32,736
Posted By InduInduIndu
sed: -e expression #1, char 0: no previous regular expression
Thanks RudiC for your response.
I verified the points you have highlighted, and there is no problem with array size & initialization.Anyways, i can assign array size to another variable and use it...
32,736
Posted By InduInduIndu
sed: -e expression #1, char 0: no previous regular expression
Hello All,

I'm trying to extract the lines between two consecutive elements of an array from a file.
My array looks like:
problem_arr=(PRS111 PRS213 PRS234)

j=0
while [ $j -le...
Showing results 1 to 15 of 15

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