10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have a small script and it runs from web application in below format:
pipe:///path_to_myscript.sh url1 url2 url3
myscript.sh:
#!/bin/bash
count=0
while
do
count=$((count+1))
exec 3>&1
((ffmpeg -i $1 ...... -f mpegts pipe:1 2>/dev/null 1>&3 ) 2>&1 | \
while read LINE; do echo... (9 Replies)
Discussion started by: baris35
9 Replies
2. HP-UX
Hello there,
I am not an expert in networking related stuff but I got a requirement to create UNIX script to query our Company's internal time source via NTP for time drift detect and report it when > +/- 50ms.
I have been googling a lot but thought to post it in this forum to get a... (17 Replies)
Discussion started by: Green_Star
17 Replies
3. UNIX for Beginners Questions & Answers
Hello there,
I am not an expert in networking related stuff but I got a requirement to create UNIX script to query our Company's internal time source via NTP for time drift detect and report it when > +/- 50ms.
I have been googling a lot but thought to post it in this forum to get a... (1 Reply)
Discussion started by: Green_Star
1 Replies
4. UNIX for Advanced & Expert Users
Hi forum,
So I am trying to determine the OS type with the following script:
#!/usr/bin/sh
OStype1=`uname -s`
Sunos1=SunOs
if
then
echo "This system is Linux"
exit 0
elif
then
echo "This system is SunOs"
exit 0
elif (1 Reply)
Discussion started by: dampio
1 Replies
5. Shell Programming and Scripting
I wish to print my current shell which happens to be bash in my script check.sh
more check.sh
echo $0
echo `ps -p $$`
But instead of printing it prints check.sh i.e the name of the script for both the commands.
Can you please suggest how to print the current shell i m on inside the... (2 Replies)
Discussion started by: mohtashims
2 Replies
6. Shell Programming and Scripting
I have to check daily 20 processes each day. The names are like Network1 Network2 Network3 ....... Network20.
There is built in utility for doing this. Following is the command to check a single network process.
check_process_status 1
If we want to check the status of Network2 then the... (6 Replies)
Discussion started by: Nakul_sh
6 Replies
7. Shell Programming and Scripting
Dear community,
what I'm try to do is deny users to run a script without parameters from command bash, but the same script should run without parameters only from crontab.
Example runs by crontab:*/5 * * * * /tmp/script.sh
Here the normal execution starts every 5 minutes
Example #1 runs by... (16 Replies)
Discussion started by: Lord Spectre
16 Replies
8. Shell Programming and Scripting
Hello,
I need a simple script to Auto-detect new files and folders in the directory.
And then I need to zip the new files and bzip2 new folders and move them out of that folder where I am detecting changes to the other folder.
Remember, I need simple one. If anyone could do it fast, I may... (1 Reply)
Discussion started by: juzt1s
1 Replies
9. Shell Programming and Scripting
Hi guys I'm very new to unix and I have to create an awk script that detects webpage addresses from a file/webpage and outputs how many times each webpage was detected.e.g. if my file was:
www.google.com
www.facebook.com
www.google.com
the output should be:
www.google.com x2... (2 Replies)
Discussion started by: ROFL
2 Replies
10. UNIX for Dummies Questions & Answers
I have a script which must not be run more than once at any given time. THis script will be scheduled to run every 20 mins as a cron job.
In my script can i have logic to say if this script is already running from the previous cron, then exit.
How do i go about doing that. If you describe the... (11 Replies)
Discussion started by: rmulchandani
11 Replies
Text::Glob(3pm) User Contributed Perl Documentation Text::Glob(3pm)
NAME
Text::Glob - match globbing patterns against text
SYNOPSIS
use Text::Glob qw( match_glob glob_to_regex );
print "matched
" if match_glob( "foo.*", "foo.bar" );
# prints foo.bar and foo.baz
my $regex = glob_to_regex( "foo.*" );
for ( qw( foo.bar foo.baz foo bar ) ) {
print "matched: $_
" if /$regex/;
}
DESCRIPTION
Text::Glob implements glob(3) style matching that can be used to match against text, rather than fetching names from a filesystem. If you
want to do full file globbing use the File::Glob module instead.
Routines
match_glob( $glob, @things_to_test )
Returns the list of things which match the glob from the source list.
glob_to_regex( $glob )
Returns a compiled regex which is the equivalent of the globbing pattern.
glob_to_regex_string( $glob )
Returns a regex string which is the equivalent of the globbing pattern.
SYNTAX
The following metacharacters and rules are respected.
"*" - match zero or more characters
"a*" matches "a", "aa", "aaaa" and many many more.
"?" - match exactly one character
"a?" matches "aa", but not "a", or "aaa"
Character sets/ranges
"example.[ch]" matches "example.c" and "example.h"
"demo.[a-c]" matches "demo.a", "demo.b", and "demo.c"
alternation
"example.{foo,bar,baz}" matches "example.foo", "example.bar", and "example.baz"
leading . must be explictly matched
"*.foo" does not match ".bar.foo". For this you must either specify the leading . in the glob pattern (".*.foo"), or set
$Text::Glob::strict_leading_dot to a false value while compiling the regex.
"*" and "?" do not match /
"*.foo" does not match "bar/baz.foo". For this you must either explicitly match the / in the glob ("*/*.foo"), or set
$Text::Glob::strict_wildcard_slash to a false value with compiling the regex.
BUGS
The code uses qr// to produce compiled regexes, therefore this module requires perl version 5.005_03 or newer.
AUTHOR
Richard Clamp <richardc@unixbeard.net>
COPYRIGHT
Copyright (C) 2002, 2003, 2006, 2007 Richard Clamp. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
File::Glob, glob(3)
perl v5.10.1 2011-03-05 Text::Glob(3pm)