Search Results

Search: Posts Made By: DeepakS
3,019
Posted By DeepakS
Could I ask why you wrote the script the way that...
Could I ask why you wrote the script the way that you did?

I think that you should be able to do everything you want to directly in perl or by making calls to the shell from your perl script. At...
Forum: IP Networking 11-02-2010
3,291
Posted By DeepakS
[Solved] DNS settings with www and without
I'm no DNS expert, and I'm hoping someone would be able to help me with this issue I'm facing.

I have a set of links in the following schema:


http://somedomain.com/xyz...
10,005
Posted By DeepakS
Math::BigFloat could express atoms in meters, so...
Math::BigFloat could express atoms in meters, so I figured that wouldn't be an issue. Likewise, I assumed that more than a couple of decimal places were necessary. If this is just for a limited...
10,005
Posted By DeepakS
My Deutsch isn't all that great, so to make sure...
My Deutsch isn't all that great, so to make sure I'm clear on what you're doing here - you want to find the number of steps between between two constant values.

Isn't this essentially a division...
10,005
Posted By DeepakS
The shell will not allow you to loop using a...
The shell will not allow you to loop using a floating point value. As a general rule floating point values should not be used in loop counters even when the language allows it.
Forum: Programming 06-18-2010
4,758
Posted By DeepakS
If you want to check the value, you'll need to do...
If you want to check the value, you'll need to do something like this:


#! /usr/bin/perl -w

use Data::Dumper;

my @array = ("apple","ball","cat","dog","elephant");

$_ = pop(@array);
...
Forum: Programming 06-17-2010
2,356
Posted By DeepakS
Nice, though that does fail in the case where...
Nice, though that does fail in the case where there is a leading space on a record.

Also, I realized I forgot to skip the header (:rolleyes:) - hope you don't mind my lifting from your code.
41,803
Posted By DeepakS
I'd recommend, as did malcolmpdx, using a package...
I'd recommend, as did malcolmpdx, using a package manager if one is available.

If you don't have one though, gcc can be built from the tarball you have as it has bootstrapping capability. Do note...
Forum: Programming 06-15-2010
2,356
Posted By DeepakS
What I'm doing here is checking to see if a line...
What I'm doing here is checking to see if a line has 'Route Distinguisher' in it, and if so then storing the key string in a variable ($buf). If not then I'm storing the values into a hash of arrays...
4,354
Posted By DeepakS
#! /bin/bash y=1; for x in *.gif; do...
#! /bin/bash

y=1;

for x in *.gif;
do mv $x file0$y.gif;
y=$[$y+1];
done;
2,279
Posted By DeepakS
Good suggestions. If I could be bold enough to...
Good suggestions. If I could be bold enough to suggest a couple of modifications, though...

Input data:


32R01000000003144476;32R01000000029054270;1000;6000;12/12/2007;0382521276;REG;Régulari;...
2,279
Posted By DeepakS
Unless you know what data to expect, there's no...
Unless you know what data to expect, there's no way to reliably determine what the delimiter in a file is.

Can you elaborate on "the file contains many values and not just 1"? Does this mean...
4,106
Posted By DeepakS
The -z...
The -z (http://tldp.org/LDP/abs/html/refcards.html) is testing to see if the string is empty.

If the test (square braces) fails then the assignment part after && doesn't execute.
1,622
Posted By DeepakS
Might as well post whatever script you have built...
Might as well post whatever script you have built so far as well.
5,614
Posted By DeepakS
The code resulted in alpha sorting, rather than...
The code resulted in alpha sorting, rather than numeric sorting, when I tried it.

This modification seems to produce results that are numerically sorted:


a=1
for s in $(echo * | sed...
4,523
Posted By DeepakS
Tough to do this with just a regex. #!...
Tough to do this with just a regex.


#! /usr/bin/perl

open(INPUT, "<input.data") || die ("Couldn't open input data");
open(OUTPUT, ">output.data") || die ("Couldn't open output data");

my...
14,887
Posted By DeepakS
Try this: sed...
Try this:


sed -e's/\<FOO\>\W\+\<\(.*\)\>\W\+\<BAR\>/\1/'
14,697
Posted By DeepakS
Try this: sed ' s/[^0-9. ]*//g s/ \+/...
Try this:


sed '
s/[^0-9. ]*//g
s/ \+/ /g
' test.html
11,393
Posted By DeepakS
Beginning Perl...
Beginning Perl (http://www.perl.org/books/beginning-perl/) is a pretty good resource, and the price is right.

Also, the ($_,ZZZZZ) bit is unnecessary - use the following:


rename($_,...
11,393
Posted By DeepakS
foreach (<*.txt>) { rename($_, substr($_,0,7)...
foreach (<*.txt>)
{
rename($_, substr($_,0,7) . substr($_,21));
}


If you're doing this in an existing script I'm assuming you'll need to glob (http://perldoc.perl.org/functions/glob.html) the...
6,392
Posted By DeepakS
Modifying the $HOME variable worked out. ...
Modifying the $HOME variable worked out.

Thanks!
6,392
Posted By DeepakS
Automating ftp without .netrc
I'm writing a script which needs to run under an 'automation' account and there is already a .netrc machine definition for the server I need to connect to.

If I create a new machine entry in the...
Forum: What is on Your Mind? 04-17-2009
13,588
Posted By DeepakS
That little guy looks like he'll provide more...
That little guy looks like he'll provide more forks than I have in my kitchen.
2,332
Posted By DeepakS
VIP membership email error
Variable for password request did not resolve properly.
11,605
Posted By DeepakS
This'll take care of it: awk -f mouse.awk...
This'll take care of it:


awk -f mouse.awk RS=" " ORS=" " animals.txt



$ cat animals.txt
cat dog pig
deer elk rabbit
mouse mouse mouse

$ awk -f mouse.awk RS=" " ORS=" " animals.txt ...
Showing results 1 to 25 of 84

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