hello
I'm a network engineer , work more than ten years.
I used centos system more than 7 years
someday i try to write some shell scripts ,but i found a problems
shell scripts like below
#!/bin/bash
cd /var/log
#rm -rf 1.txt
time=`date |awk {'print $2,"",$3'}`
#time=`date |awk {'print $2,$3'}`
cat /dev/null > 1.txt
cat secure | grep Fail | grep "$time" > 1.txt
the command "date | awk {"print $2,$3"} "
when the date from 1 to 9 the script was write
when the date from 10 to 31 the problem was show
the problem is the space
so wo try to add a space in my shell script
is this a bug ?
i hope you can reply