Pretty obvious I guess. I am actually a storage engineer, but I need to automate some cli scripts that will add storage to a Hitachi array.
BTW: It turns out I have to get this to work in Perl. I do the following and it retruns what I want, but it looks like it must have a lot of whitesapce after it, so I tried to strip it off with...
CODE:
#!/usr/bin/perl
print `clear` , "\n";
print "Site: ";
chomp ($site= <>);
$ asite=`grep $site -A 1 ips.txt | grep http`;
$ nw=`echo $asite | sed 's/^[ ]*//'`;
print "$nw\n";
EXEC CODE AND RESULTS
testsys> ./test.pl
Site: USA
sh: -c: line 1: syntax error near unexpected token `|'
sh: -c: line 1: ` | sed 's/^[ ]*//''
http://123.123.123.123
testsys>
I know there is a lot of space after the results, as I tested this by adding a couple of other vars and it moved them to the next line. Any ideas?