Sponsored Content
Top Forums Shell Programming and Scripting How I can replace this command --need help Post 302122804 by sudhish on Thursday 21st of June 2007 01:07:54 PM
Old 06-21-2007
Deletion of first line is the problem

Hi,
Let me explain my requirement
1. $path/cash.log is a cash file, I can't rename it because it content is loaded by another script
2. This script will send SMS until cash.log file become empty also it will continue check for the messages, start sending sms as soon as the message comes
3. Script can only take first line of the cash.log file and send SMS
4. Then I have to delete the first line, other wise script will always send same message only

Deletion of first line is the problem

Thanks in advance
Sudhish
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Command to replace character

I've been googling for the following for the past few weeks several times, but haven't yet come across something that I could easily grasp. Can someone point me in the right direction please? I'm trying to replace a character in file names, i.e. the character is a period, and I want to replace... (5 Replies)
Discussion started by: HLee1981
5 Replies

2. UNIX for Dummies Questions & Answers

vi command - replace

Hi, Given a long text file. How can I replace all full stops- with semicolon thanks, tictactoe (1 Reply)
Discussion started by: tictactoe
1 Replies

3. UNIX for Dummies Questions & Answers

find and replace command in one line using one command

Hi, I have a entry in the file as ::BSNL GUJARAT::India::OUT::NAT::REWEL::POSTPAID::919426199995 if u see this, i have the delimiter as :: , all i want is to replace "::" as ":" so how to do that.. pls help thanks (10 Replies)
Discussion started by: vasikaran
10 Replies

4. Shell Programming and Scripting

problem with replace command with tr

I have a sample file like this 7829885 7831552 + 1 1667, 0, 35934936 35937087 - 2 1281,870, 0,1281, I would like to replace values starts with comma with just value like 0, to 0 or 1667, to 1667. I can do with this by using tr -d '0,' '0' <file But the... (2 Replies)
Discussion started by: repinementer
2 Replies

5. Shell Programming and Scripting

find and replace command

Hi, i used to do on soalris box but in linux box i am not able to do advice is appreciated uname -a Linux intranet 2.4.20-pre3 #1 Tue May 6 17:55:35 IST 2008 i686 unknown $ find /usr/local/ -type f | xargs perl -pi -e 's/172.16.1.14/172.16.1.27/g' Can't remove /usr/local/bin/dbhome:... (1 Reply)
Discussion started by: prakash.gr
1 Replies

6. Shell Programming and Scripting

Please help replace character command

hi i have log : i want remove some char become like this: anybody can help me ? (7 Replies)
Discussion started by: justbow
7 Replies

7. UNIX for Dummies Questions & Answers

Replace command

Hi , I have a sequence which looks like this Lsat01000001 Lsat01000002 Lsat01000003 .. Lsat01000999 .. Lsat01100001 Lsat01278544 i want my output to look like this: seq1 seq2 seq3 ... seq999 (1 Reply)
Discussion started by: siya@
1 Replies

8. UNIX for Dummies Questions & Answers

Global replace command help

Hello - I am trying to use a global replace command but its not working. Here is the cmd I am using in vi: :%s/OLD/NEW/g However, in my "NEW" I already have a "/" which is not making the replace work: :%s/mytestscript.com:33232/mytestscript:70245/test.com/g the... (2 Replies)
Discussion started by: DallasT
2 Replies

9. Shell Programming and Scripting

sed replace command

Hi. I need to append/prefix an & character to every 'single' & character (not when there are 2 or more grouped together) I find in a file. I can do it using this cmd: cat ${file} | sed -e 's/&/&&/g' > ${new_file} How can I modify this to ensure I only replace single &'s and not operate... (11 Replies)
Discussion started by: user052009
11 Replies

10. Shell Programming and Scripting

sed Command to replace particular value.

Hi , My input file contain : list = 3 14 15 10 9 11 12 18 19 20 21 22 23 24 25 26 6 1 2 3 4 5 7 8 16 17 27 28 30 29 Expected output : list = 0 0 0 0 0 0 0 18 0 20 0 0 0 0 0 0 6 0 0 3 4 0 0 0 0 0 0 0 0 0 I want to keep the 8,10,16,17,22 value from the list and put 0 on rest of the... (9 Replies)
Discussion started by: Preeti Chandra
9 Replies
GSMSMSD(8)						      System Manager's Manual							GSMSMSD(8)

NAME
gsmsmsd - SMS message reception daemon SYNOPSIS
gsmsmsd [ -a action ] [ --action action ] [ -b baudrate ] [ --baudrate baudrate ] [ -c concatenatedID ] [ --concatenate concatenatedID ] [ -C service centre address ] [ --sca service centre address ] [ -d device ] [ --device device ] [ -D ] [ --direct ] [ -f ] [ --flush ] [ -h ] [ --help ] [ -I init string ] [ --init init string ] [ -r ] [ --requeststat ] [ -s spool directory ] [ --spool spool directory ] [ -t SMS store name ] [ --store SMS store name ] [ -v ] [ --version ] [ -X ] [ --xonxoff ] { sms_type } DESCRIPTION
gsmsmsd reads new incoming SMS from the mobile phone and dispatches them to a user-defined action. Additionally it can send SMS message that it reads from a spooldir. gsmsmsd attaches itself to the device given on the command line (usually an GSM modem) using the specified baudrate and waits for incoming SMS messages. If no device is given, the device /dev/mobilephone is used. If no baudrate is given, a default baud rate of 38400 is used. If no action is given, the SMS message is printed to the standard output. If an action is specified the action is excecuted using the shell and the SMS message is written to the standard input of the action. gsmsmsd needs one empty storage slot for SMS messages in the mobile phone, otherwise SMS reception will not work. The SMS store to use for temporary storage of incoming SMS can be selected using the --store option, otherwise the ME default store is used. To terminate gsmsmsd cleanly (without losing SMS messages) one should send either SIGINT (CTRL-C on the command line) or SIGTERM to the process. Error messages are printed to the standard error output. If the program terminates on error the error code 1 is returned. sms_type may be any combination of: sms, no_sms Controls reception of normal SMS messages. cb, no_cb Controls reception of cell broadcast messages. stat, no_stat Controls reception of status reports. The default is sms, cb, and stat. OPTIONS
-a action, --action action The action to execute for each incoming SMS message. If no action is given the SMS is written to the standard output. -b baudrate, --baudrate baudrate The baud rate to use. -c concatenatedID, --concatenate concatenatedID If an ID is given, large SMSs are split into several, concatenated SMSs. All SMSs have the same ID and are numbered consecutively so that the receiving phone can assemble them in the correct order. IDs must be in the range 0..255. This number is increased by one for every outgoing concatenated SMS and wraps around after 255. Not all receiving phones will support concatenated SMSs (and dis- play them as separate SMSs), since all the numbering and ID information is carried in the user data header element at the beginning of the SMS user data. This information may show up as garbage in such phones. -C service centre address, --sca service centre address Sets the service centre address to use for all SUBMIT SMSs (may not work with some phones). -d device, --device device The device to which the GSM modem is connected. The default is /dev/mobilephone. -D, --direct Enables direct routing of incoming SMS messages to the TE. This is not supported by many mobile phone/GSM modem combinations. There- fore, the default is to store incoming SMS temporarily before processing them in the indicated store. -f, --flush This option causes gsmsmsd to flush (ie. read and erase) existing SMS messages from the SMS store selected by the --store option. The action given by the --action option is executed on each of the flushed SMS. This option should be used to ensure that enough space is available in the SMS store for temporary storage of incoming SMS, otherwise incoming SMS might be ignored silently by the ME. -h, --help Prints an option summary. -I init string, --init init string Initialization string to send to the TA (default: "E0"). Note that the sequence "ATZ" is sent first. -r, --requeststat Request status reports for sent SMS. Note: This option only makes sense if the phone supports routing of status reports to the TE. Otherwise the status reports might show on the phone's display or get lost. -s spool directory, --spool spool directory This option sets the spool directory where gsmsmsd expects SMS messages to send. The format of SMS files is very simple: The first line contains the phone number of the recipient. Everything else after the first line is interpreted as the SMS text. Please refer to gsmsendsms(1) for details on the SMS text character set and maximum length. gsmsmsd polls the spool directory every 5 seconds. Sent SMS message files are removed. -t SMS store name, --store SMS store name The name of the SMS store to read from (for the --flush option) or write to (for temporary SMS storage). This option must be must be used in conjunction with the --flush option. If this option is omitted the ME uses it's default SMS store for temporary storage of incoming SMS. A commonly available message store is "SM" (SIM card). -v, --version Prints the program version. -X, --xonxoff Uses software handshaking (XON/XOFF) for accessing the device. EXAMPLES
The following invocation of gsmsmsd sends each incoming SMS message as a mail to the user "smsadmin": gsmsmsd -d /dev/ttyS2 -b 19200 -a "mail smsadmin" This is the format of SMS deliver messages as output from gsmsmsd: ---------------------------------------------------------------- Message type: SMS-DELIVER SC address: '491710762100' More messages to send: 1 Reply path: 0 User data header indicator: 0 Status report indication: 0 Originating address: '01805000102' Protocol identifier: 0x39 Data coding scheme: default alphabet SC timestamp: 17.12.98 14:10:55(+0100) User data length: 159 User data header: 0x User data: 'Nicht vergessen! Die XtraWeihnachtsverlosung lauft noch bis zum 24.12. Nutzen Sie jetzt Ihre Gewinnchance und faxen Sie Ihren Teiln.-Gutschein an 0180/5000 056' ---------------------------------------------------------------- This is the format of SMS status report messages as output from gsmsmsd: ---------------------------------------------------------------- Message type: SMS-STATUS-REPORT SC address: '' More messages to send: 0 Status report qualifier: 0 Message reference: 0 Recipient address: '' SC timestamp: 00.00.00 00:00:00(+0000) Discharge time: 00.00.00 00:00:00(+0000) Status: 0x0 'Short message received by the SME' ---------------------------------------------------------------- The following invocation of gsmsmsd flushes all existing messages from the "SM" SMS store and looks in the "/tmp/spooldir" directory for SMS to send: gsmsmsd -d /dev/ttyS2 --spool /tmp/spooldir -f --store sm --action 'mail smsadmin' FILES
/dev/mobilephone Default mobile phone device. AUTHOR
Peter Hofmann <software@pxh.de> BUGS
Cell broadcast SMS message reception has not been tested, but it has been enabled in the gsmsmsd daemon. The mobile phone device is blocked when the gsmsmsd daemon is running, ie. it cannot be used for data transfer or from the other programs of this suite (gsmpb, gsmsms). Report bugs to software@pxh.de. Include a complete, self-contained example that will allow the bug to be reproduced, and say which version of gsmsmsd you are using. COPYRIGHT
Copyright (C) 1999 Peter Hofmann gsmsmsd is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. gsmsmsd is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with gsmsmsd; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. SEE ALSO
gsminfo(7), gsmpb(1), gsmctl(1), gsmsendsms(1), gsmsmsstore(1). gsmsmsd v1.10 Sat Jun 16 22:10:00 UTC 2012 GSMSMSD(8)
All times are GMT -4. The time now is 03:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy