10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, guys, i have a script i inherited from a coworker but i'm not perl savy. The script works but i would like it to work better. I want to run this command
./ciscomgrtest.pl -r "show version" -h hosts.router
and have the script goto each router in the hosts.router file and run the command... (2 Replies)
Discussion started by: whipuras
2 Replies
2. Shell Programming and Scripting
Hi,
I have the following lines that I would like to see in an array for easy comparisons and printing:
Example 1:
field1,field2,field3,field4,field5
value1,value2,value3,value4,value5Example 2:
field1,field3,field4,field2,field5,field6,field7... (7 Replies)
Discussion started by: ejdv
7 Replies
3. Shell Programming and Scripting
Hi,
my xml files looks something like this
<Instance Name="New York">
<Description></Description>
<Instance Name="A">
<Description></Description>
<PropertyValue Key="false" Name="Building A" />
</Instance>
<Instance Name="B">
... (4 Replies)
Discussion started by: tententen
4 Replies
4. Shell Programming and Scripting
I was trying to figure out a way to split along a CR in a variable.
In the code below, the result for CPU returns
CPU=`cat /proc/cpuinfo | grep -i 'model name' |awk -F ':' '{ print $2}'`
for
echo $CPU
AMD Phenom(tm) 9850 Quad-Core Processor AMD Phenom(tm) 9850 Quad-Core Processor... (7 Replies)
Discussion started by: baggins2000
7 Replies
5. Shell Programming and Scripting
Hey all,
perl - how can we name a variable base on the value of another variable?
for example in ksh/bash we do :
export c="100"
export x`echo $c`=2000
echo $x100
x100=2000
is it possible to do something similar for perl?
I already tried many ways but nothing is working.
I am... (3 Replies)
Discussion started by: cacm1975
3 Replies
6. Shell Programming and Scripting
Hi There!
I'm trying to write a shell script which generates a random hexadecimal number and then appends it to the end of lines XX onwards of a certain file. XX is determined by a certain string on the previous line.
Thus for example, if the input file is
I search for the string... (3 Replies)
Discussion started by: orno
3 Replies
7. Shell Programming and Scripting
Hi Everyone,
i have a string 00:44:40
so:
$tmp=~ s/://gi;
$tmp=~s/({2})({2})({2})/$1*3600+$2*60+$3/e;
the output is 2680.
Any way to combine this two lines into a single line?
Thanks (4 Replies)
Discussion started by: jimmy_y
4 Replies
8. Shell Programming and Scripting
Hi,
New problem, or challenge as they prefer in the US.
I need to insert some lines in a file before certain other lines.
To make it more clear:
Original file:
aaaa
bbbbb
ccccc
ddddd
bbbbb
fffff
ggggg
Now I want to insert the line "NEW_NEW_NEW" when I match "fffff", but I want... (7 Replies)
Discussion started by: ejdv
7 Replies
9. Shell Programming and Scripting
Hi All,
I am trying to convert the below Csh while loop into Perl while loop but the problem is that in this csh script, i have 2 variables inside a variable -> $count is a variable {SB$count} as a whole is another variable. Csh is able to assign values to such variable like the below but i do... (3 Replies)
Discussion started by: Raynon
3 Replies
10. Shell Programming and Scripting
I have a text file that contains a word on each line. I want to be able to use each word as a variable to be put into a URL. I have been trying to put together a for loop but I am not having much luck. So basically all I am trying to do is
for line in ~/desktop/test.txt
do
curl -s... (4 Replies)
Discussion started by: iCONAN
4 Replies