"alister" you are correct. Thanks for bringing that up..
I know parsing a script file and filtering only comment strings from it would be much more complicated, I will not go there..
Let me make it clear, my requirement is to parse only property files with possible formats like -->
From what I know so far, if I choose to use Syntax2 from above, I should have a self imposed restriction of
Do not use block comments Do not use inline comments
Do you agree it would meet a 99% satisfactory solution ?
---------- Post updated at 11:32 PM ---------- Previous update was at 11:12 PM ----------
Quote:
I just ask myself why somebody will ever want to ripoff "perfectly" the comments from a script file
Sorry, my input file is never going to be a script file. Its going to be a file with mostly user defined parameters.
Most of my scripts are either interactive or batch,, Almost all of them with cusomizable values for pre-defined parameters. With '0' hardcoded values in my scripts.
If I do not remove comments at the end of line, it may go into my last variable, in case if I want to use --> $@
same is true with spaces at the front or end of line.
Where IN_FILE_FILTER=$(echo "^([\040|\t]*(#|$))").
I am trying to find a better way of filtering comments from my input property files..
---------- Post updated 05-04-10 at 12:51 AM ---------- Previous update was 05-03-10 at 11:32 PM ----------
"danmero",, I just checked your latest command,, its working as I wanted. Many Thanks to you. Thanks to everyone that helped.
Last edited by kchinnam; 05-04-2010 at 12:46 AM..
Reason: formatting again
Hello All,
I want to print data in between two lines in a file sample.txt through more or cat command on the screen. For that I am using below sed command to give the BEGIN and END text.
Content of sample.txt
server01:~ # cat /proc/mdstat
Hello this is a text message 1
Hello this is a... (5 Replies)
I searched and found "echo -n" and "printf" are solution for this, but they are not
here:
$ echo "hello" >> test
$ cat test
hello
$ echo -n "world" >> test
$ cat test
hello
world
$ echo -n " seriously?" >> test
$ cat test
hello
world seriously?
This is not successful... (15 Replies)
I cannot seem to get this to work..
I have a file which has about 100 lines, and there is no end of line (line break \n) at the end of each line, and this is causing problem when i paste them into an application.
the file looks like this
this is a test
that is a test
balblblablblhblbha... (1 Reply)
So, I want to read line-by-line a text file with unknown number of files....
So:
a=1
b=1
while ; do
b=`sed -n '$ap' test`
a=`expr $a + 1`
$here do something with b etc
done
the problem is that sed does not seem to recognise the $a, even when trying
sed -n ' $a p'
So, I cannot read... (3 Replies)
Hi,
I want to filter record from a file if the records in the second column matches the data in another file. I tried the below awk command but it filters the records in the filter file. I want the opposite, to include only the records in the filter file.
I tried this:
awk -F'|'... (8 Replies)
Hello.
I am a french newbie in unix shell scripting (sorry if my english speaking is wrong).
I have a file with path and filenames in it. I want to limit the number of characters on each line and break the line if necessary. But the "break" should occur after a slash caracter "/".
Example of... (9 Replies)
Hi All,
I have a script that reads a file and echo it back to std out.
Test.txt
1aaaaaaaaaaa .
The script is ReadLine.sh
#!/bin/ksh
cat $1 | while read file
do
echo $file
done
I invoke the script as ReadLine.sh Test.txt
The output that I get is (1 Reply)
Hi,
Apologies if this has been asked before, but I searched and was not able to find an answer. It's probably a simple question to answer for those of you with some experience, though...
I have a relatively long string where tokens are separated by the colon (':') character. Let's say the... (10 Replies)
Hi!
1. I have a parameter file containing path to log files. For this example both paths are the same, one is stated directly and the second using env variables.
/oracle/admin/orcl/bdump/:atlas:trc:N
${ORACLE_BASE}/admin/${ORACLE_SID}/bdump/:${ORACLE_SID}:trc:N
2. I try to parse the path... (1 Reply)
We have to convert a sequential file to a 80 char line sequential file (HP UX platform).The sequential file contains special characters. which after conversion of the file to line sequential are getting coverted into "new line" or "tab" and file is getting distorted. Is there any way to read these... (2 Replies)