10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
i`m looking for some way to add to some date an partial number of months, for example to 2015y 02m 27d + 2,54m
i need to write this script in php or bash or sh or mysql or perl in normal time o unix time
i`m asking or there are any simple way to add partial number of month to some... (14 Replies)
Discussion started by: bacarrdy
14 Replies
2. Shell Programming and Scripting
Hi
I am trying to store the output of a command into an array in perl script.
I am able to store but the problem is i am unable to print the array line with one line space. i mean i inserted the \n in loop ...but not getting the result.
I have written like this
#!/usr/bin/perl
@a =... (2 Replies)
Discussion started by: kumar85shiv
2 Replies
3. Shell Programming and Scripting
I have requirment to get last date of previous month and the first date of previous 4th month:
Example:
Current date: 20130320 (yyyymmdd)
Last date of previous month: 20130228 (yyyymmdd)
First date of previous 4th month: 20121101 (yyyymmdd)
In my shell --date, -d, -v switches are not... (3 Replies)
Discussion started by: machomaddy
3 Replies
4. Shell Programming and Scripting
Respected All,
Kindly help me out.
I have got file listings in a directory like this:
-rw-r--r-- 1 root root 115149 2011-11-17 07:15 file1.stat.log
-rw-r--r-- 1 root root 115149 2011-11-18 08:15 file2.stat.log
-rw-r--r-- 1 root root 115149 2011-11-19 09:15 file3.stat.log
-rw-r--r-- 1... (2 Replies)
Discussion started by: teknokid1
2 Replies
5. Shell Programming and Scripting
Hi, How to create array every time user input and store user input and display all array
print " Enter input "
my @input = split(' ', $input)
chmop($input = <STDIN>;
foreach ($input)
{
@array= @input;
}
print @array"\n"; (1 Reply)
Discussion started by: guidely
1 Replies
6. UNIX for Dummies Questions & Answers
Hi folks
month=`date +%m`gives current month
Howto print previous month (current month minus 1) with Solaris date and ksh (7 Replies)
Discussion started by: slashdotweenie
7 Replies
7. Shell Programming and Scripting
Hi All,
I want to find the time diffrence between currnt time and "abc.txt" file create time.
I have solve that but if the abc.txt file created last month then is there any process to find the difftent?
Exp:
Create time of abc.txt is "Apr 14 06:48"
and currect date is "May 17 23:47".... (1 Reply)
Discussion started by: priyankak
1 Replies
8. Shell Programming and Scripting
Suppose there are two arrays of arrays:
@A = ( , , , );
@B = ( , , , , );
For each of $A, $A, $A..., I want to find the corresponding one in @B (match the letter, like $A eq $B), and print out both the second item, for example, $A and $B.
How can I do this in perl? grep + map? Hope I... (1 Reply)
Discussion started by: zx1106
1 Replies
9. Shell Programming and Scripting
hi
this is an example of code:
use strict;
use warnings;
open FILE, "/tmp/result_2";
my $regex="\\ Starting program ver. (.*)";
my $res="Program started, version <$1> - OK.\n";
while (<FILE>) {
if ($_ =~ /($regex)/) {
print "$res";
}
}
close FILE;
This finds $regex and print... (3 Replies)
Discussion started by: xist
3 Replies
10. Shell Programming and Scripting
Hi
I'm trying to find a way to search a text file for a specific string.
I have a file which contains i.p. addresses and port numbers in the following format:
'ip="www.xxx.yyy.zzz"'
'port="xx""'
I want to print only the parts between the double quotes for use in seperate variables,... (4 Replies)
Discussion started by: melias
4 Replies