Hi guys, I hope you can enlight me with a script I'm doing for Solaris 10.
Script goes like this:
Script uses another perl script who outputs date as YYYYMMDDHHMMSS (ex. 20110425151745)
Well, then I put ls -la to calculate the size of yesterday's file, and today's file.
Problem is I don't know how to compare the size of yesterday's file ($fechayer) to today's file ($fechahoy) and then, if the difference of the size is 20% less than yesterday, abort script with error.
What would be the algorithm for calculating that difference of size in percentage?
if fechahoy<fechayer by more than 20% --->then abort
Hope you help me, thanks a lot!
---------- Post updated at 02:20 PM ---------- Previous update was at 01:22 PM ----------
Can we find some of size of all files in a directry where file names start with an letter t*
the out put of ls -ls t* is
4 -rw-r--r-- 1 root system 61 Jul 03 10:56 t
4 -rw-r--r-- 1 root system 3146 Jul 19 11:11 t1
4 -rw-r--r-- 1 root system ... (2 Replies)
I am trying to join to files with dramatically different sizes (file 1: 1 column - 9000 rows, file 2: 13 cols, 26 million rows). I can't seem to get join to work. I have check to ensure that there are matches and have tried subsamples that work. The -a filenum flag lists all the rows, so join is... (4 Replies)
Hi,
I am trying to write a script that will use ls on a directory and list the files one at a time and their size. If the size is 0 i want it to ask me if I want to delete it (yes or no). If I say yes, I want it to delete but it won't know what the file name is just from running from the script.... (2 Replies)
I'm writing a KSH shell script that's using SQL though DB2.
If I have a table defined and populated
db2 "create table tb(num int,letter char(4))"
db2 "insert into tb values(111,a)
db2 "insert into tb values(112,b)
db2 "insert into tb values(111,c)
How can I check if a letter user... (0 Replies)
Hey guys,
need help with a script I'm trying to write.
Basically I need to compare the contents of a folder called "profiles"
with a list of files called "template".
when the file matches the contents of the folder it needs to set a variable called "checked" to "1"
Cookies to anyone... (4 Replies)
Need assistance in getting File size for the List of files using perl script . I have writtern 2 codes. One of them gives me the list of files and 2nd one give me the size for only 1 file.
I dont know how to club both of them to get the list of files with its size .
#!/usr/bin/perl -w... (11 Replies)
Good day, everyone!
I'm very new to bash scripting. Our teacher gave us a task to create a script that basically does the same job the 'du' command does, with the difference that 'du' command gives an output in the form of
<size> <folder name>and what we need is
<folder name> <size>As for... (1 Reply)
1. The problem statement, all variables and given/known data:
The task is to create a script that would reproduce the output of 'du' command, but in a different way: what 'du' does is:
<size> <folder name>and what is needed is
<folder name> <size>We need to show only 10 folders which are the... (3 Replies)
Hello,
I need to compare the size of a file to what it's size was 20min ago. So far my outline script is:ls -ls /home > filesizeafter.txt
compare filesizeafter.txt filesizebefore.txt > filesizechange.txt
if /home filesizechange.txt > 100 {
email root;
}
ls -ls /home >... (2 Replies)