okay my script for the shar section looks like this at the mo:
if
echo "cat > $file <<\!EnShAr!\"
echo "\!EnShAr!"
echo "set `cksum $file`"
echo"cksum" $file
check=$1
echo "test $1 = $check || echo $0: bad cksum in $file >&2 " >> sharS
echo "cat > $file <<\!EnShAr!" >> sharS
fi
-----------------------------------------------------------------------------------
If I do as told to do buy the last post:
"echo "cat > $file <<\!EnShAr\!"
Then it crashes at the fi not being expected,
if I don't it still crashes saying that the end of line is not expected at the end,
Got to watch those exclamation marks. They mean something special in sh, even inside double quotes. Maybye make that !EnShAr! thing a variable so you don't have to type the various crazy escapings every time?
There is nothing wrong with this:
And that will work fine with the Bourne shell too. When a for statement does not have an explicit list, it will step through the positional parameters. Call that little script "fortest" and and it with:
./fortest one two three
It will work fine.
Next, shells have special characters like " and $ that mean special things. Generally a backshash will remove the special meaning from a special character. Now look at this line:
echo "cat > $file <<\!EnShAr!\"
You have removed the special meaning from the last quote so it does not match up with the first quote. So the shell reads the next line and find a normal quote there that ends the quoted string. Your quoted string contains a quote and it goes into a second line which is legal. Now everything is mexed up and the shell will finally barf on the last quote.
Have you tried running it on unix? it does not seem to work on mine, if you can show me a version you know works and I'll see if I'm the one with unix being difficult, thanks
i don't mean the whole thing by the way, just this shar section, i don't wanna have to rewrite the script to use differnt functions. Thanks for any help given
Hi, this is a cut down version that I have written from scratch to try and solve the problems I'm having:
#!/bin/sh
filevalidate()
{
case $# in
0) echo "Usage enshar file1 file2 ... > outputFile ! " > /bin/sharF/error ;;
*) for filename
do
if [ -d $filename ]; then
echo "invalid path name " > $filename > /bin/sharF/error
exit 2
fi
done ;;
esac
}
for filename in $*
do
filevalidate $filename
done
for filename in $*
do
echo cat \> $filename \<\<"\\!EnShAr\!"
cat < $filename
echo "\!EnShAr\!"
echo set \`cksum $filename\'
set `cksum $filename'
echo "test \$filename = $filename || echo \$0: BAD checksum in $filename > /bin/sharF/error"
done
exit 0
Does anyone see any issues? I could not get it to work so I took the end section from:
for filename in $*
do
echo cat \> $filename \<\<"\\!EnShAr\!"
and tried to run it alone, but an error occurs on line 7 to do with "`
Can someone check my ` ' " please and my redirection stuff, and if the cksum looks like that should work because I have been unable to test it.
Can someone please assist!!!
Hi everyone!
Ok so I'm trying for the first time to install AIX on a LPAR with NIM.
The NIM:
root@oaexpnimp01(/home/root) # oslevel -s
6100-08-02-1316
I'm trying to install AIX 6.1 TL1. I successfully created a new lpp source
root@oaexpnimp01(/home/root) # lsnim -l AIX61_TL1_2... (10 Replies)
Hi there can anyone help me to spot my mistake and please explain why it appears
My code :
#!/usr/bin/gawk -f
BEGIN { bytes =0}
{ temp=$(grep "datafeed\.php" | cut -d" " -f8)
bytes += temp}
END { printf "Number of bytes: %d\n", bytes }
when I am running ./q411 an411
an411:
... (6 Replies)
Dear Admins,
The SPOT defined in NIM is for aix 5.3 TL 7 . Some of the NIM clients are upgraded to TL 10 . Now the SPOT level is older than the mksysb level.
This will cause problem during restoration of any NIM clients.
Now i want to upgrade SPOT level to TL 10 and redefine the resources... (3 Replies)
HI. there
My 10 servers are running on 6.1-05-03 aix including NIM server
but my user want to update a TL (61-05-03 to 61-06-04)
if I Update a AIx version of TL .. is that change the SPOT of NIM server..
OR if I make a spot of AIX7.1 and Is that support AIX 6.1 AIX 5.3 Images
I... (1 Reply)
Hello im new here and i shot stright with question.
Mainly i wanna ask , how do i search with regexp in one spot and show the whole thing, what im trying to ask is , for eg. i do ls -l, and i see all the info for the dirs and dats. now say i wanna get all the dats that in their name they start... (2 Replies)
Hey
May be a dumb question
Can I use a SPOT which is at 5.3 TL6 to boot an LPAR (with 5.3 TL8) in to maintenance mode? Will it work ?
Is it mandatory that SPOT should be of same or higher version in such case?
Bala (1 Reply)
does somebody know about SPOT ?? any link about SPOT commands ?
i ve made a mistake during configuration, :mad:
then i ve started the system in Maintenance mode
the only shell was SPOT. :eek:
SPOT doesn t understand anything....
how do i work with SPOT ?
thanks in advance
Karine... :D (1 Reply)