Code using GREP only works after login. Needs to work on boot up??
Hi,
i've had this problem with grep for a few days. i just dont understand whats going on. When i run this code automatically at boot up it only half works. where as if i run it after boot it runs perfectly fine. the code is supposed to retrieve an item from the KERNEL line. my expected/desired result is hdl. /etc/rc.local Code:
#!/bin/sh -e Code:
1) video=geodefb initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw splash=silent mode=hdl ip=172.16.103.100 BOOT_IMAGE=/boot/vmlinuz Code:
1-auto) manual means i typed /etc/rc.local to invoke the code after login. any ideas at all? Thanks in advance, Andy. |
it seems to be the regular expression part of the Grep statement that is throwing it out.
the '[a-Z]*' is the bit that fails when the script is run during boot up. i have a symbolic link to the script at S99 in rcS.d. so it gets run just before rc.local (pretty much). perhaps the libraries or something for reg-ex have not been loaded at this point??? |
Moin,
are your sure, that at boot time the following prerequisites are defined? 1. Is your /bin/sh really the bash or is it a simple Bourne shell at boot time (you are using bash specific syntax)? 2. Is the egrep path defined in the PATH environment variable? I'm not sure that the commands you use are really available. Try this: 1. Do a /bin/ls -l /bin/sh 2. Do a type egrep within your script. Normally the path to egrep (on my system /usr/bin/egrep) is not defined for rc scripts. Jan |
Most of the time your $PATH won't include /usr/bin during initialization. Logging in corrects this. Try using /usr/bin/egrep.
ta0kira |
All times are GMT -5. The time now is 11:16 PM. |