Bash Script bombs on embedded Linux system (Altiris)
I use a linux pre-installation environment to image workstations with Windows XP. This deployment product is Symantec's Altiris Deployment Solution. We are trying to build an automated installer that asks the tech questions, which will be inserted into the sysprep of the Windows system. We are trying to build DVD disks that will image for places without direct access to an altiris server.
And have a working way to drop down my image, which is good. What's bad is how built-in scripts are handled vs. typed commands... To "make sure" these scripts would work, I created them after booting to the Linux environment from a Linux Managed altiris environment. Ran the scripts and they worked, just fine... so I committed them to the boot disk. I get odd errors when trying to run the exact same scripts that I verified working by typing them in manually. Here's an example of code from my script that is completely bombing out. This information is important because we manually modify our sysprep file when imaging (we have 5 domains and potential domain admins for joining): Code:
#!/bin/bash Problem is, I'm getting errors that would hint towards a command interpreter or keyboard error... errors such as: (I've bolded manual input) Code:
Enter DOMAIN to join mydomain.com Code:
echo "Please enter DOMAIN " |
What is not really clear to me is: have you edited these files under windows or under linux? If you have edited the scripts under windows, most likely the line terminator is a carriage return which is not correctly managed by shell scripts in linux. I mean you have to convert them in Unix format prior to feed the shell with these script.
In Linux you can do this using the dos2unix command. Or eventually rewrite the scripts in a Linux environment using vi or any other available editor. I bet the problem magically disappear. |
Quote:
|
THat was it, thanks colucix!
|
All times are GMT -5. The time now is 12:29 PM. |