10-23-2009
Remove "/" from a string
Hi,
I've a string "200910/22-101010" ( this is date and time string YYYYMMDD/HHMMSS format) , how can i remove "/" and assign it to a new variable a value of 20091022 only
thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear friends, following is the output of a script from which I want to remove spaces and new-line characters.
Example:-
Line1 abcdefghijklmnopqrstuvwxyz
Line2 mnopqrstuvwxyzabcdefghijkl
Line3 opqrstuvwxyzabcdefdefg
Here in above example, at every starting line there is a “tab” &... (4 Replies)
Discussion started by: anushree.a
4 Replies
2. Shell Programming and Scripting
input string="3MMTQSZ348GGMZRQWMJM4SD6M"
output string="3MMTQ-SZ348-GGMZR-QWMJM-4SD6M"
using linux shell script (4 Replies)
Discussion started by: pankajd
4 Replies
3. Shell Programming and Scripting
This is the way
sed -i 's/home/$USER/.config/hello_there//g' /home/$USER/.gnomerc
But, as far as I saw you cannot add any "/" in the string you want to remove....
So, what should I do in order to remove this path (which contains "/") ?:confused: (7 Replies)
Discussion started by: hakermania
7 Replies
4. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
5. Shell Programming and Scripting
Hello everyone
Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried
sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies
6. Shell Programming and Scripting
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
Discussion started by: timmywong
8 Replies
7. Shell Programming and Scripting
I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here.
I have following script (called out_to_streams.csh):
#!/bin/tcsh -f
echo Redirected to STDOUT > /dev/stdout
echo Redirected to... (2 Replies)
Discussion started by: marcink
2 Replies
8. Shell Programming and Scripting
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies
9. Shell Programming and Scripting
Hi Everyone, i am new to scripting and stuck in something.
Query is : I have a properties file eg. data.properties.
This data.properties have some values
example :
key1=value1
key2=value2
#key3=value3
as key3 is commented by #.
so i want to write a script , that will remove # from... (3 Replies)
Discussion started by: Raj87ng
3 Replies
10. Shell Programming and Scripting
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies
LEARN ABOUT DEBIAN
gammu-smsd-files
GAMMU-SMSD-FILES(7) Gammu GAMMU-SMSD-FILES(7)
NAME
gammu-smsd-files - gammu-smsd(1) backend using filesystem as a message storage
DESCRIPTION
FILES backend stores all data on a filesystem in folders defined by configuration (see gammu-smsdrc for description of configuration
options).
RECEIVING OF MESSAGES
Received messages are stored in a folder defined by configuration. The filename will be IN<date>_<time>_<serial>_<sender>_<sequence>.<ext>,
for example NN20021130_021531_00_+45409000931640979_00.txt.
Explanation of fields:
<date> date in format YYYYMMDD
<time> time in format HHMMSS
<sender>
sender number
<serial>
order of a message (in case more messages were received at same time), in format NN
<sequence>
part of the message for multipart messages, in format NN
<ext> txt for text message, 8-bit messages are stored with bin extension, smsbackup for gammu-smsbackup
The content of the file is content of the message and the format is defined by configuration directive InboxFormat (see gammu-smsdrc).
TRANSMITTING OF MESSAGES
Transmitted messages are read from a folder defined by configuration. The filename should be one of the following formats:
o OUT<recipient>.<ext>
o OUT<priority>_<recipient>_<serial>.<ext>
o OUT<priority><date>_<time>_<serial>_<recipient>_<note>.<ext>
Explanation of fields:
<recipient>
recipient number where to send message
<priority>
an alphabetic character (A-Z) A = highest priority
<ext> txt for normal text SMS, smsbackup for gammu-smsbackup
<note> any artibrary text which is ignored
For text messages, you can additionally append flags to extension:
d delivery report requested
f flash SMS
b WAP bookmark as name,URL
Other fields are same as for received messages.
For example OUTG20040620_193810_123_+4512345678_xpq.txtdf is a flash text SMS requesting delivery reports.
SMSes will be transmitted sequentially based on the file name. The contents of the file is the SMS to be transmitted (in Unicode or stan-
dard character set).
The contents of the file is the SMS to be transmitted (in Unicode or standard character set), for WAP bookmarks it is split on as Name,URL,
for text messages whole file content is used.
Please note that if file is not in Unicode, encoding is detected based on locales, which do not have to be configured if SMSD is running
from init script. If this is your case, please add locales definition to init script.
AUTHOR
Michal iha <michal@cihar.com>
COPYRIGHT
2009-2012, Michal iha <michal@cihar.com>
1.31.90 February 24, 2012 GAMMU-SMSD-FILES(7)