I am trying to do an upgrade on a VMWare appliance. I am getting an error, and I dug into the script that is causing the error and will post the statement that is causing the error. Basically, my software seems to want an additional partition before it will do the upgrade. So, I added a new partition to the VM and left it in every possible state - formatted, not formatted, mounted, not mounted.. etc. I am going to post the script, if you can help me understand what the fdisk -l (list fdisk) output is causing this to error - I would appreciate it. I will also post the section that is next which is what would happen if it succeeded. Thank you in advance for your help.
Moderator's Comments:
Please view this code tag video for how to use code tags when posting code and data.
I don't think there should be an extra newline there. which the shell script could insert. I may be wrong. Can you run fdisk with the value of $RESET_HDD manually, emulating what the code is trying to do: enter a p and enter a q
If you can decide what $TMPFILE2 and $TMPFILE1 translate to, try
This will tell you if you got a straight p and q. Some versions of echo do NOT by default decode \n into a newline. You may be getting garbage like "pn". fdisk will produce an error as well that you can see.
What the script code is doing is running the fdisk program "interactively" with canned responses. A more reasonable approach is a here doc, as above.
Do you have nonstandard aliases or symlinks for the shells - /bin/bash especially? what does the output of
give? It should be "echo is a shell builtin". The "real" bash echo will ignore those \n characters. Otherwise you may get garbage in $TMPFILE1
gives
NO extra newline characters or garbage extraneous characters.
Last edited by jim mcnamara; 09-23-2012 at 12:57 AM..
I have one bash shell script to execute table refreshment. At the bottom of script, I have one piece of code to check 'ORA-' error from log file, then send email to DBA or application people. But this piece of code didn't work. I tried different ways and also search online to find where is my... (2 Replies)
Hi Everyone,
I am using gdb-7.5 to connect to the target. When I gave the./configure --target=xyz --build=i686-pc-mingw32 --host=i686-pc-mingw32 command then
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking target system type... xyz-mingw32... (3 Replies)
Hi All,
Please see the below script for mysql 3 commands. Its giving me the right output for all three commands but showing some errors in first two commands , i guess there might be an issue with date.
Can anyone help me .
#! /bin/bash
TABLE_NAME=testingddatabase
USER_NAME=root... (3 Replies)
Im tryign to write a script that counts the number of new lines in the file with the most new lines in a given directory
i keep getting this error
/export/home/sieben01/itec400/homework> ./maxlines.sh
./maxlines.sh: syntax error: `then' unexpected operator/operand
any ideas?
... (11 Replies)
Hi
How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Hello,
I have written a shell script and suppose there is any error in the script. How i can do exception handling in shell script.for example i have below code
sqlplus -s <<uid>>/<<pwd>>@<<$ORACLE_SID>> <<EOF > 1_pid1.log
set pagesize 0
set feedback off
set heading off
set linesize 200... (1 Reply)
#! /bin/sh
abcd = "Hello world"
if
then
echo $abcd
fi
i got error message that
line3 : abcd: command not found
line5 : [0: command not found
line5 : [1: command not found
i have no idea why i got this message. Can some one help me ??? (6 Replies)
i am trying to work on a simple shell script as
#!/bin/bash
filename = $2
if ; then
echo " Displaying the Content of the file:"
filename = $2
cat filename
else
if ; then
echo "Displaying directory listing:"
ls -l filename
else
echo " Commands not correct:"
fi
done
it shows the... (3 Replies)
When i run the script firecall.sh,i am getting a weird error.
root: ./var/ADMIN/bin/firecall.sh d12381
./var/ADMIN/bin/firecall.sh: ?osrc: command not found
./var/ADMIN/bin/firecall.sh: ?osrc: command not found
The script is successful,but the error interests me...Any Ideas??
The... (1 Reply)