[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
The string of characters in the special character by grep as a command
From: |
fengyalei |
Subject: |
The string of characters in the special character by grep as a command |
Date: |
Sat, 21 Aug 2010 14:00:00 +0800 |
HI:
Now, I have four files in my directory:alarm.log
,alarm.log.20100802125915,alarm.log.wf and control.log; I will extract
information from alarm.log.wf, orders for grep - E "FATAL|WARNING" |tail -n
1, at the command line -- I got the correct output WARNING: 08-04 20:41:11:
alarm * 1126189408 close log_r.1126189408.wf.
But use script: ss =`grep -E "FATAL|WARNING" alarm.log.wf|tail - n 1`, echo
$ss, output is WARNING: 08-04 20:41:11: alarm alarm.log
alarm.log.20100802125915 alarm.log.wf control.log close
log_r.1126189408.wf.It took "*" in the string as a special characters .I
think this is a bug.
Could you give me a resultion?Makeing the script and command line have same
output.
Think you!
Yalei Feng . CHina
- The string of characters in the special character by grep as a command,
fengyalei <=