10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
Anyone please covert this in perl language
########################
if ps faux | grep -v grep | grep ProcessXYZ
then
echo "$SERVICE is running, , everything is fine"
exit 0
else
echo "$SERVICE is not running"
exit 2
fi
Additional... (1 Reply)
Discussion started by: fed.linuxgossip
1 Replies
2. Ubuntu
hello everybody,
i'm a beginner in ash and i want to convert this bash script to ash.
this script send a xml file to a nagios server :
#!/bin/bash
PROGNAME=$(basename $0)
RELEASE="Revision 0.3"
print_release() {
echo "$RELEASE"
}
print_usage() {
echo ""
echo "$PROGNAME... (6 Replies)
Discussion started by: mdijoux25
6 Replies
3. Shell Programming and Scripting
Hello all!
This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician.
Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix:
... (16 Replies)
Discussion started by: torchij
16 Replies
4. Shell Programming and Scripting
Hi all,
Not sure if this should be in the programming forum, but I believe it will get more response under the Shell Programming and Scripting FORUM.
Am trying to write a customized df script in Perl and need some help with regards to using arrays and file handlers.
At the moment am... (3 Replies)
Discussion started by: newbie_01
3 Replies
5. Shell Programming and Scripting
I'm attempting to parse a file whose contents follow this format;
4:/eula.1028.txt:
8:/eula.1031.txt:
19:/eula.1033.txt:
23:/eula.1036.txt:
27:/eula.1040.txt:
31:/eula.1041.txt:
35:/eula.1042.txt:
39:/eula.2052.txt:
43:/eula.3082.txt:
The number of lines of the file... (4 Replies)
Discussion started by: CudaPrime
4 Replies
6. Shell Programming and Scripting
Hi there, I need to test that a variable ($VAR) matches a regex mask in BASH. I have the exact thing working in perl (below), but could somebody advise me how i would do the same in BASH ? do i need to use something like egrep ?
#!/bin/perl -w
my $VAR = "some value";
if ( $VAR =~... (4 Replies)
Discussion started by: rethink
4 Replies
7. Shell Programming and Scripting
can any body translate the follwing script into one that works in bash?
#!/usr/bin/perl
# classify_books.pl
my $csv_file = shift;
my %categories = ( 'childrens' => 'childrens_books.txt',
'horror' => 'horror_books.txt',
'sports ' =>... (3 Replies)
Discussion started by: ferrycorsten73
3 Replies
8. Shell Programming and Scripting
Hello All. I am very new to Linux and I am currently interning. I have been working on a project for 2 weeks now and I have had no success. I have to convert bash shell into perl to decrypt and store files. Here is the code in Linux and Bash. Any help would be greatly appreciated.
$... (0 Replies)
Discussion started by: freak
0 Replies
9. UNIX for Dummies Questions & Answers
Hello All. I am very new to Linux and I am currently interning. I have been working on a project for a week and I have had no success. I have to convert bash shell into perl to decrypt and store files. Here is the code in Linux and Bash. Any help would be greatly appreciated.
$... (0 Replies)
Discussion started by: freak
0 Replies
10. Shell Programming and Scripting
Hi,
I have to write a program to compare 2 files for copying.
the program is ran on Solaris 5.8 like this:
script.sh file1.txt file2.txt
I wrote the program using bash and it took me forever since I am a beginner but it works very well.
I'm getting so close to the deadline and I... (2 Replies)
Discussion started by: Chris Jones
2 Replies
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