Sponsored Content
Top Forums Shell Programming and Scripting Could not get script name running from ps -ef command ? Post 302479795 by bh_hensem on Monday 13th of December 2010 02:45:03 AM
Old 12-13-2010
hi...

my script as below:-
Code:
#!/usr/bin/perl -w

use warnings;
use strict;
use POSIX qw(floor);
use POSIX qw(strftime);

my $exp = strftime "%d/%m/%Y %H:%M:%S", localtime(time + 86400);
my $data;

print ("...SMS GATEWAY START...\n");
while (1) {
	if (-e "/cygdrive/c/Inetpub/ftproot/CSV_SMS.csv") {
		system("/cygdrive/c/CLISMS.exe /port=1 /ussd=*122#");
		my $credit = qx(cat /cygdrive/c/Log.txt |grep \"Baki\" |tail -1 |cut -d, -f1);
		$credit =~ s/Baki: //g;
		my $val = "$credit";
		$val =~ s/\s//g;
		$credit = floor($credit + 0.5);

		if ($credit < 10) {
		system("/cygdrive/c/CLISMS.exe /port=1 /to=0133034931 /msg=[SMS Gateway] URGENT!! Current prepaid credit is RM$val. Please reload");
		system("/cygdrive/c/CLISMS.exe /port=1 /to=0193301010 /msg=[SMS Gateway] URGENT!! Current prepaid credit is RM$val. Please reload");
		}

		open (LOG, ">> /cygdrive/c/Inetpub/ftproot/sms.log");
		open (TEXT, "/cygdrive/c/Inetpub/ftproot/CSV_SMS.csv");
		while ($data = <TEXT>) {
		  chomp($data);
		  next if ($data =~ /TelNo/);
		  my ($num,$msg) = split(/;/, $data);
		  system("/cygdrive/c/CLISMS.exe /port=1 /to=$num /msg=$msg");
		  print(LOG "$exp,$num,$msg\n");
		  sleep 60 if $. % 10 == 0;
		}
		close (TEXT);
		close(LOG);
		system ("rm /cygdrive/c/Inetpub/ftproot/CSV_SMS.csv");
	}
	sleep 5;
}

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Running a command or script as root

I'm writing an application (Progress language) that needs to: 1) load the contents of a cron table into the Progress application; 2) display this information in a human manner and allow a select group of people to update it (these people are logged in as themselves, not as root); 3) save... (3 Replies)
Discussion started by: rm-r
3 Replies

2. Shell Programming and Scripting

running multiple rsh command in a script

hi scripting experts, juz wondering if it's possible to have multiple rsh command in a single script? :confused: ie: rsh -l <username> "<command>" rsh -l <username> "<command>" thanks. regards, wee :) (0 Replies)
Discussion started by: lweegp
0 Replies

3. Shell Programming and Scripting

Command Not running in script

Hi Everyone , have a nice day root@sdp01a>SS7Manager -status the problem with above given expression is that i cant add it in script , it only executes if manually given at remote node , can anyone tell me some way to run it in scripts , also i have few more commands aswell , which are for... (2 Replies)
Discussion started by: Dastard
2 Replies

4. Shell Programming and Scripting

Running function or command concurrently in a bash script

I currently run a script over a vpnc tunnel to back-up my data to a remote server. However for a number of reasons the tunnel often collapses. If I manually restore the tunnel then the whole thing can continue, but I want to add into my script a section whereby while the transfer is taking place,... (8 Replies)
Discussion started by: dj_bridges
8 Replies

5. UNIX for Dummies Questions & Answers

A command in a script not running in Crontab.

Hi, I made this script for TRU Unix 5.1 OS based Node. When the script was run manually all the commands were running properly. But when it was run from Crontab, one command is not running. This command is not running when the script is running from Crontab: #... (2 Replies)
Discussion started by: mystition
2 Replies

6. Shell Programming and Scripting

running shell command in Perl script

Does not work. #!/usr/bin/perl $etcdir = 'ls -l /etc'; print $etcdir; #END ------------result-------- #perl -w abc123.pl ls -l /etc # This method works. #!/usr/bin/perl $etcdir = system("ls -l /etc"); print $etcdir; #END (2 Replies)
Discussion started by: dplinux
2 Replies

7. Shell Programming and Scripting

Running at command - Parent script getting killed

I have a script that calls another script within it that takes about 1 hour to execute. I am noticing that the parent script that calls the child script is getting killed. Does anyone know why? The child script still runs. (3 Replies)
Discussion started by: 3junior
3 Replies

8. UNIX for Advanced & Expert Users

Running ksh script from command line

Hi. I have a ksh script I want to run, but I'm connecting through a telnet and I don't want to FTP the scripts itself. is there a way of running the script from command line ? like ksh "The script itself..." Thanks, Ramon (4 Replies)
Discussion started by: mellowcandle
4 Replies

9. Shell Programming and Scripting

ps command showing full code of running script

Hi, I have a script running while rsync command is fired to push some files. The output of rsync cmd has been redirected to the script which is used to generate log files containing progress info with formatting. when I enter ps -ef | grep rsync it shows the full scripting code on the cmd line... (2 Replies)
Discussion started by: rajeevra
2 Replies

10. UNIX for Beginners Questions & Answers

Need a Bash script for iterating thru an array and running a command

Hi , I am a total beginner so bear with me. I have the below code which works . I need to extend it by iterating thru the array arr and executing a command in each loop. some thing on the lines of below. I need to run this in a Jenkins script , so I would need below bash script to run... (6 Replies)
Discussion started by: SVRao19056
6 Replies
Regexp::Common::CC(3pm) 				User Contributed Perl Documentation				   Regexp::Common::CC(3pm)

NAME
Regexp::Common::CC -- provide patterns for credit card numbers. SYNOPSIS
use Regexp::Common qw /CC/; while (<>) { /^$RE{CC}{Mastercard}$/ and print "Mastercard card number "; } DESCRIPTION
Please consult the manual of Regexp::Common for a general description of the works of this interface. Do not use this module directly, but load it via Regexp::Common. This module offers patterns for credit card numbers of several major credit card types. Currently, the supported cards are: Mastercard, Amex, Diners Club, and Discover. SEE ALSO
Regexp::Common for a general description of how to use this interface. <http://www.beachnet.com/~hstiles/cardtype.html> Credit Card Validation - Check Digits <http://euro.ecom.cmu.edu/resources/elibrary/everycc.htm> Everything you ever wanted to know about CC's <http://www.webopedia.com/TERM/L/Luhn_formula.html> Luhn formula AUTHORS
Damian Conway (damian@conway.org) and Abigail (regexp-common@abigail.be). MAINTAINANCE
This package is maintained by Abigail (regexp-common@abigail.be). BUGS AND IRRITATIONS
Bound to be plenty. Send them in to regexp-common@abigail.be. LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2009, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD Licence. See the file COPYRIGHT.BSD. 4) The MIT Licence. See the file COPYRIGHT.MIT. perl v5.14.2 2010-02-23 Regexp::Common::CC(3pm)
All times are GMT -4. The time now is 05:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy