lwnexgen2
October 9th, 2008, 10:32 PM
Hey Guys-
I am trying to write a bash script that'll check a file for a line of code specified in a different file, and add the specified line of code if it doesn't exist.
The specified line is:
1)
* * * * * root ./usr/bin/mg_backup.sh
Since that is all that's in the file, I am running
check_line=$(cat filename)
to fill check_line with the values, but for some reason, even though "cat filename" works fine and outputs 1), the the value of check_line is a list of all the files in my home directory for some reason.
I assume this is because there are wildcard characters in my line, so does anyone know how I can get around this?
Thanks!
I am trying to write a bash script that'll check a file for a line of code specified in a different file, and add the specified line of code if it doesn't exist.
The specified line is:
1)
* * * * * root ./usr/bin/mg_backup.sh
Since that is all that's in the file, I am running
check_line=$(cat filename)
to fill check_line with the values, but for some reason, even though "cat filename" works fine and outputs 1), the the value of check_line is a list of all the files in my home directory for some reason.
I assume this is because there are wildcard characters in my line, so does anyone know how I can get around this?
Thanks!