11-01-2006
code tags for code please. It makes code readable. Like {code} stuff {/code} except with [ ] instead of { }.
I take it $1 is the stat file? What is the a=`cat $1` bit for? $a isn't even used anywhere else.
If $a is used anywhere else, this'd be the weak point. Shell variables have size limits. Use pipes instead.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi, I have a directory PRIVATE in which I have several directories and each of these have several files. Therefore, I need to find those files by size and date to back up those files in another directory.
I don't know how to implement this shell script using ''find''.
appreciate any... (1 Reply)
Discussion started by: dadadc
1 Replies
2. Shell Programming and Scripting
Basic:
find . -type f -name “*.txt” -print | awk '{gsub("Ontem", "AntesdeOntem", $0); print > FILENAME}' *.txt
The idea is in folder /home/myapontamentos
I have some files and i need to change in all them the word "ontem" to "antesdeontem".
But bigger files are cut (size i mean)... (4 Replies)
Discussion started by: single
4 Replies
3. Shell Programming and Scripting
hi,
i am facing a problem in merging two files using awk,
the problem is as stated below,
file1:
A|B|C|D|E|F|G|H|I|1
M|N|O|P|Q|R|S|T|U|2
AA|BB|CC|DD|EE|FF|GG|HH|II|1
....
....
....
file2 :
1|Mn|op|qr (2 Replies)
Discussion started by: shashi1982
2 Replies
4. Shell Programming and Scripting
Hi,
I have a requirement
I have to find out the same size of files with different name in a particular directory.
For ex: I have around 1 lack records in a directory and in that I have
abcd.jpg, abcd_1.jpg with same size each.
I need to seperate these two records from that file.... (3 Replies)
Discussion started by: siri_886
3 Replies
5. Shell Programming and Scripting
Dear all,
Please help me to write a script that can calculate the size of files.
For example: I have a directory which contain thousands of files. I need to know the size of files that their name begin with abc_123
Thank all!! (4 Replies)
Discussion started by: hainguyen1402
4 Replies
6. Shell Programming and Scripting
To find the whole size of a particular directory i use "du -sk /dirname".. but after finding the direcory's size how do i make conditions like if the size of the dir is more than 1 GB i hav to delete some of the files inside the dir (0 Replies)
Discussion started by: shaal89
0 Replies
7. Emergency UNIX and Linux Support
We are regularly using for our testing, where we are manually filling up the mount with desired size with following command
dd if=/dev/zero of=file_2GB bs=2048000 count=2000
We are planning to automate the task where taking input for % of size as one input and the name of the file system... (8 Replies)
Discussion started by: chandu123
8 Replies
8. Shell Programming and Scripting
Hello, I am trying to write a shell script in unix which looks for the last two files in a folder, checks their size and reports(via mail) if either of their file size is =0.
cd /tmp
list last two files: ls -ltr | tail -2
check if size of any of these two files is 0
if true, then send a... (8 Replies)
Discussion started by: kiran1112
8 Replies
9. Red Hat
Hi ,
My linux server is taking more time to calculate big size from long time.
* i am accessing server through ssh
* commands
# - du -sh *
#du -sh * | sort -n | grep G
Please guide me for fast way to find big size directories under to / partition
Thanks (8 Replies)
Discussion started by: Nats
8 Replies
10. UNIX for Beginners Questions & Answers
I am new at developing EXPECT scripts. I'm trying to create a script that will automatically connect to a several UNIX (sun solaris and HPUX) database server via FTP and pull the sizes of the listener/alert log files from specified server directory on the remote machines.
1. I want the script... (7 Replies)
Discussion started by: mikebantor
7 Replies
LEARN ABOUT DEBIAN
libbash
LIBBASH(7) libbash Manual LIBBASH(7)
NAME
libbash -- A bash shared libraries package.
DESCRIPTION
libbash is a package that enables bash dynamic-like shared libraries. Actually its a tool for managing bash scripts whose functions you may
want to load and use in scripts of your own.
It contains a 'dynamic loader' for the shared libraries ( ldbash(1)), a configuration tool (ldbashconfig(8)), and some libraries.
Using ldbash(1) you are able to load loadable bash libraries, such as getopts(1) and hashstash(1). A bash shared library that can be loaded
using
ldbash(1) must answer 4 requirments:
1. It must be installed in $LIBBASH_PREFIX/lib/bash (default is /usr/lib/bash).
2. It must contain a line that begins with '#EXPORT='. That line will contain (after the '=') a list of functions that the library
exports. I.e. all the function that will be usable after loading that library will be listed in that line.
3. It must contain a line that begins with '#REQUIRE='. That line will contain (after the '=') a list of bash libraries that are
required for our library. I.e. every bash library that is in use in our bash library must be listed there.
4. The library must be listed (For more information, see ldbashconfig(8)).
Basic guidelines for writing library of your own:
1. Be aware, that your library will be actually sourced. So, basically, it should contain (i.e define) only functions.
2. Try to declare all variables intended for internal use as local.
3. Global variables and functions that are intended for internal use (i.e are not defined in '#EXPORT=') should begin with:
__<library_name>_
For example, internal function myfoosort of hashstash library should be named as
__hashstash_myfoosort
This helps to avoid conflicts in global name space when using libraries that come from different vendors.
4. See html manual for full version of this guide.
AUTHORS
Hai Zaar <haizaar@haizaar.com>
Gil Ran <ril@ran4.net>
SEE ALSO
ldbash(1), ldbashconfig(8), getopts(1), hashstash(1) colors(1) messages(1) urlcoding(1) locks(1)
Linux Epoch Linux