Search Results

Search: Posts Made By: Ganesh Mankar
1,932
Posted By RudiC
Try [ "$port" != "PORT_C" ] && { read -p"Do you...
Try [ "$port" != "PORT_C" ] && { read -p"Do you want to continue script? " ANS; [ "${ANS^*}" != "Y" ] && exit; }
1,932
Posted By RudiC
Continue the original script OR run a new script?...
Continue the original script OR run a new script? However, look into your shell's man page for the case statement.
1,932
Posted By RudiC
Please read the proposal carefully. It does...
Please read the proposal carefully. It does exactly what you specified: if PORT_A or _B, it asks the user and, if answer is y or Y , it sources a script called "script". If PORT_C, it does not ask...
1,932
Posted By RavinderSingh13
Hello Ganesh, RudiC code is good, only...
Hello Ganesh,

RudiC code is good, only thing please change PORT_C to port_C, it should work then I think.

Thanks,
R. Singh
1,932
Posted By RudiC
Don't call/source another script, exit the...
Don't call/source another script, exit the original script.
1,932
Posted By RudiC
Try [ "$port" != "PORT_C" ] && { read -p"Do you...
Try [ "$port" != "PORT_C" ] && { read -p"Do you want to run script? " ANS; [ "${ANS^*}" == "Y" ] && . script; }
1,734
Posted By Akshay Hegde
Try this awk '/[^-]-[^-].*:/{s = $1; next }...
Try this

awk '/[^-]-[^-].*:/{s = $1; next } NF==5 && $1~/[0-9]+/{print $2,s,$NF}' infile
1,734
Posted By Akshay Hegde
[akshay@localhost tmp]$ cat infile [...
[akshay@localhost tmp]$ cat infile
[ U-UU-YRYT-NOD-6002 ] GETA-TILL-INF;

U-UU-YRYT-NOD-6002 2015-05-14 THU 19:44:10
C2221 RETRIEVE TILL INFORMATION : COMPLD
...
1,734
Posted By Scrutinizer
No I mean directly, without using heads and...
No I mean directly, without using heads and tails..

cmd_sys NOD_$y GETA-TILL-INF | awk 'NR==3{s=$1} NR==8{p=1} /--/{p=0} p{print s, $NF}'
1,734
Posted By RudiC
Please use code tags, NOT ICODE tags! You...
Please use code tags, NOT ICODE tags!

You haven't given any rule on how to select a) the prefix b) the data/data lines. Making wild assumptions, this will give the desired result for EXACTLY the...
5,475
Posted By sea
For a new one, you writing quite complex scripts...
For a new one, you writing quite complex scripts :p
Anyway, just writing the basics, try (untested):
while read tIP pIP
ping6 -c1 $pIP | grep -e trans -e ms && \
echo "$pIP : Found"...
5,475
Posted By sea
Good morning: I'd start by changing the main...
Good morning:

I'd start by changing the main loop, first and last line:
To:
while read tIP pIP
...
done</home/lotus/bin/cmd/$iptable_fil
So it now reads the the first value for 't'elnet-ip,...
5,516
Posted By Don Cragun
As has been stated many times, your requirement...
As has been stated many times, your requirement for a CSV output file and your requirement for fixed width output fields are conflicting requirements. The fact that you have presented three...
5,516
Posted By CarloM
Do you mean you want the output in fixed-width...
Do you mean you want the output in fixed-width columns?
5,516
Posted By Don Cragun
When you don't use CODE tags to show how your...
When you don't use CODE tags to show how your input is formatted, it confuses volunteers trying to help you. When you say you want CSV output and show us text that is not in the format of a CSV file...
5,516
Posted By RudiC
How about trying sth yourself? Anyhow, tryawk...
How about trying sth yourself? Anyhow, tryawk 'BEGIN {print "NODE ID IP"} {gsub(/\(|\)|\[|\]|NOD_/,_); print $2, $3, $6}' file
NODE ID IP
U-UU-LVDT-NOD-6002 4406 1234:333:aaa:2333:3:2:333:a
.
.
.
5,516
Posted By CarloM
Do you have GNU awk? Try: awk '/NOD/...
Do you have GNU awk?

Try:
awk '/NOD/ {print $2 OFS $4 OFS $11}' FS=' |\\]|\\[|\\)|\\(' Output.TXT

Or this should work on any version:
awk '/NOD/ {print $2 OFS substr($3,2,length($3)-2) OFS...
5,516
Posted By RudiC
Try alsoawk '{gsub(/\(|\)|\[|\]|NOD_/,_); print...
Try alsoawk '{gsub(/\(|\)|\[|\]|NOD_/,_); print $2, $3, $6}' file
U-UU-LVDT-NOD-6002 4406 1234:333:aaa:2333:3:2:333:a
U-UU-LVDT-NOD-6004 3805 1234:333:aaa:2333:3:2:333:e
U-UU-LVDT-NOD-6005 4288...
1,387
Posted By Corona688
If we don't answer immediately, wait! Nobody...
If we don't answer immediately, wait! Nobody here is "on call".

You must alter your expect script to return a value, 0 on success, 1 on error, so that your shell script can tell if anything goes...
2,284
Posted By RudiC
> ip.csv would suffice, I think. This would not...
> ip.csv would suffice, I think. This would not delete the file but render it empty.
2,284
Posted By sea
The $ is not a command ;) Change it to: ...
The $ is not a command ;)

Change it to:
echo "" > ip.csv

hth
2,336
Posted By Scrutinizer
You can do something like this NodeId=$1 if [...
You can do something like this
NodeId=$1
if [ -z "$NodeId" ]; then
printf "%s" "Enter the node ID here: "
read NodeId
fi

and then use $NodeId instead of $1 everywhere
2,336
Posted By Don Cragun
Knowing what shell and operating system you're...
Knowing what shell and operating system you're using could make a big difference here. In addition to what Scrutinizer suggested, maybe something like this will help with your problem:
#!/bin/ksh...
8,057
Posted By RudiC
Please use code tags as required by forum rules! ...
Please use code tags as required by forum rules!

doesn't help us help you. Please be very specific with error messages.

Does this work if executed IN your script:
Mod_1.sh NODE_5
Mod_2.sh...
8,057
Posted By sea
Please use CODE tags, the icon with the text...
Please use CODE tags, the icon with the text 'code' on it.
The iCodes are nice to provide a sample code without the need of line break, not applicable for script or debug output!

Any luck making...
Showing results 1 to 25 of 25

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