03-17-2011
That's what the contents of the file really are, so it is reading it fine. You just got Unicode when you expected ASCII. Or got something stranger when you expected ASCII -- what is MOF? If this was never readable text to begin with, just renaming it won't make it suddenly be readable text.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
#!/usr/bin/sh
echo "Enter reason:"
echo "> \c"
read $reason
$reason >> access.log
This doesnt work for me. Can someone tell me how I would read the input from what the person types, and then append that to the log file?
Regards (2 Replies)
Discussion started by: alwayslearningunix
2 Replies
2. Shell Programming and Scripting
I'm reading 2 input files but not getting expected value.
I should get an alpha value on file_1_data but not getting any.
Please help.
>cat test6.sh
awk '
FILENAME==ARGV { file_1_data=$0; print "----- 1 Line " NR " -----" $1; next }
FILENAME==ARGV { file_2_data=$0; print "----- 2... (1 Reply)
Discussion started by: pdtak
1 Replies
3. Shell Programming and Scripting
Hi guys,
I am new to AWK and unix scripting. Please see below my problem and let me know if anyone you can help.
I have 2 input files (example given below)
Input file 2 is a standard file (it will not change) and we have to get the name (second column after comma) from it and append it... (5 Replies)
Discussion started by: sksahu
5 Replies
4. Shell Programming and Scripting
Okay, so I've looked on here and found some similar things, but not exactly what I am looking for. I am working on creating a script that can back up some files, based on the contents of another file - the configuration file.
First file contains the files to back up - we'll call this... (1 Reply)
Discussion started by: pdxwarrior
1 Replies
5. Shell Programming and Scripting
Hello
Can someone help me to write a perl script or kornshell reading a two files and outputting to comma format.
Here is the two files
listofdisks.txt
id, diskname, diskgroup, diskisze(GB), FC
1, CN34, GRP1, 30, FC_CN34
2, CN67, GRP5, 19,
4, VD1, GRP4, 23, FC_VD1
6, CF_D1, ... (0 Replies)
Discussion started by: deiow
0 Replies
6. Shell Programming and Scripting
I am reading a file using While loop
while <FILE>
{
$_ = <FILE>;
process data...
}
I would like to quit reading the file once I encounter a String pattern. How do i do it.
is it
if (/SUMMARY/)
{
last;
}
I am having problems with uninitialized value in pattern... (1 Reply)
Discussion started by: subhap
1 Replies
7. Shell Programming and Scripting
Hello,
I'm trying to write an awk program that reads two files inputs.
example,
file 1:
0.00017835
0.000176738
0.00018811
0.000189504
0.000188155
0.000180065
0.000178991
0.000178252
0.000182513
file 2:
1.7871769E-05 1.5139576E-16 1.5140196E-16 1.5139874E-16
1.7827407E-04 ... (5 Replies)
Discussion started by: joseamck
5 Replies
8. Shell Programming and Scripting
I've always written scripts where the user executes the script and I prompt them for what they want to do.
But I'm trying to write a script where root executes the script 'lock' or its hard-link 'unlock' and the script will passwd -l or passwd -u an account depending on the choice.
What would... (3 Replies)
Discussion started by: ADay2Long
3 Replies
9. Shell Programming and Scripting
If the user inputs two variants separated by a comma, the below command is supposed to write both variants to the GJ-53.txt and then to out.txt. Both are written to the GJ-53.txt, however only one is written to out.txt and I'm not sure why. Thank you :).
gjb2() {
printf "\n\n"
... (1 Reply)
Discussion started by: cmccabe
1 Replies
10. Open Source
I have a process that requires me to read data from huge log files and find the most recent entry on a per-user basis. The number of users may fluctuate wildly month to month, so I can't code for it with names or a set number of variables to capture the data, and the files are large so I don't... (7 Replies)
Discussion started by: rbatte1
7 Replies
LEARN ABOUT DEBIAN
gammu-backup
GAMMU-BACKUP(5) Gammu GAMMU-BACKUP(5)
NAME
gammu-backup - gammu(1) backup file format.
The backup format is text file encoded in either ASCII or UCS-2-BE encodings.
This file use ini file syntax, see ini.
EXAMPLES
If you will backup settings to Gammu text file, it will be possible to edit it. It's easy: many things in this file will be written double
- once in Unicode, once in ASCII. When you will remove Unicode version Gammu will use ASCII on fBrestorefR (and you can easy edit ASCII
text) and will convert it according to your OS locale. When will be available Unicode version of text, it will be used instead of ASCII
(useful with Unicode phones - it isn't important, what locale is set in computer and no conversion Unicode -> ASCII and ASCII -> Unicode is
done).
You can use any editor with regular expressions function to edit backup text file. Examples of such editors can be vim or TextPad which
both do support regular expressions.
Remove info about voice tags
Find:
^Entry([0-9][0-9])VoiceTag = (.*)
Replace:
<blank>
Change all numbers starting from +3620, +3630, +3660, +3670 to +3620
Find:
Type = NumberGeneral
Entry([0-9][0-9])Text = "+36(20|30|60|70)
Replace:
Type = NumberMobile
Entry1Text = "+3620
Change phone numbers type to mobile for numbers starting from +3620, +3630,... and removing the corresponding TextUnicode line
Find:
Type = NumberGeneral
Entry([0-9][0-9])Text = "+36([2367]0)([^"]*)"
Entry([0-9][0-9])TextUnicode = ([^
]*)
Replace:
Type = NumberMobile
Entry1Text = "+3623"
See also
converting-formats
AUTHOR
Michal iha <michal@cihar.com>
COPYRIGHT
2009-2012, Michal iha <michal@cihar.com>
1.31.90 February 24, 2012 GAMMU-BACKUP(5)