From: Thomas 'PointedEars' Lahn on
moonhkt wrote:

> On 3月30日, 上午6時14分, pk <p...(a)pk.invalid> wrote:
>> [...]
>
> Thank a lot.

Learn to post. Reply to the posting you are referring to.

> This script for perpare tar file for code migration from
> UAT machine to Live machine.
> Try on AIX 5.3

I don't have AIX.

> for i in "$MDIR"/{load,src} not work on AIX.
> tst_ls.ksh[7]: /phx/migration/{load,src}: not found.

It is probably rather a matter of ksh than of AIX, although the ksh manpage
suggests otherwise.

> Try on AIX not work.

Learn English work better.

> Just list current directory
> $ /bin/ls -p | sed '/[\/=@|]/d'
> abc.txt

What a pointless exercise appending the directory slash (`-p') only to
remove it afterwards. `-p' will also not append `=', `@' or `|', that's
what `-F' would do. RTFM.

> List of file and directory
> [...]

Whatever this is, the above command cannot have put it out (it's like an -l
listing). Unless, of course, you have aliases in place in which case all
bets are off.

> FYI, For my testing, I does not know how to get /phx/migration/load/
> load-01 using -name .
> #!/bin/ksh
> # AIX 5.3(a)OFFICE, cygwin(a)HOME
> MDIR=/phx/migration
> for i in $MDIR/load $MDIR/src
> [...]

You still don't get it, do you? With find(1) *you* *do* *not* *need*
`for'!

And with tar(1) -- as you finally say -- you probably won't even need
find(1) as you would want to migrate the whole directory structure.

Thanks for wasting my time :-(

<http://www.catb.org/~esr/faqs/smart-questions.html>


Score adjusted

PointedEars
From: Phred Phungus on
Thomas 'PointedEars' Lahn wrote:

>> #!/bin/ksh

I'm coming to this thread late. What is this line that looks like a
shebang perl line but not quite?

I thought it was an executable till I looked for it:

$ cd /bin
$ ls ksh
ls: cannot access ksh: No such file or directory
$ man ksh
No manual entry for ksh
$

TIA
--
fred
From: Thomas 'PointedEars' Lahn on
Phred Phungus wrote:

> Thomas 'PointedEars' Lahn wrote:
>>> #!/bin/ksh
>
> I'm coming to this thread late. What is this line that looks like a
> shebang perl line but not quite?

Shebang is a language-independent feature when it comes to shell scripting
on Unixes:

<http://en.wikipedia.org/wiki/Shebang_(Unix)>

> I thought it was an executable till I looked for it:
>
> $ cd /bin
> $ ls ksh
> ls: cannot access ksh: No such file or directory

ls /bin/ksh

would have sufficed.

> $ man ksh
> No manual entry for ksh
> $

So you probably have no Korn shell (ksh) (manpage) installed.
Other people might have.

<http://en.wikipedia.org/wiki/Korn_shell>

Please read and adhere to <http://www.interhack.net/pubs/munging-harmful/>
should you desire further helpful replies.

--
PointedEars
From: moonhkt on
On 3月30日, 下午6時47分, Thomas 'PointedEars' Lahn <PointedE...(a)web.de>
wrote:
> Phred Phungus wrote:
> > Thomas 'PointedEars' Lahn wrote:
> >>> #!/bin/ksh
>
> > I'm coming to this thread late.  What is this line that looks like a
> > shebang perl line but not quite?
>
> Shebang is a language-independent feature when it comes to shell scripting
> on Unixes:
>
> <http://en.wikipedia.org/wiki/Shebang_(Unix)>
>
> > I thought it was an executable till I looked for it:
>
> > $ cd /bin
> > $ ls ksh
> > ls: cannot access ksh: No such file or directory
>
>   ls /bin/ksh
>
> would have sufficed.
>
> > $ man ksh
> > No manual entry for ksh
> > $
>
> So you probably have no Korn shell (ksh) (manpage) installed.
> Other people might have.
>
> <http://en.wikipedia.org/wiki/Korn_shell>
>
> Please read and adhere to <http://www.interhack.net/pubs/munging-harmful/>
> should you desire further helpful replies.
>
> --
> PointedEars

Thank All. Provide useful information to me. Next time, try to provide
more information.

# Scope
# 1. Generate file list, list.lst, base on selected directory under /
phx
# a. grep -il "string" *, under /phx, -s sting
# b. base on user input file , -f file_name.lst
# c. Select all files under /phx
# 2. List of file will be build zip file, pkzip -@list.lst
# after zipped. rm file base on list.lst
# 3. Build backup and move base on list.lst
# cp -p abc.p abc.p.yymmdd_hhmm [C-1]
# mv /phx/migration/src/abc.p /phx/src [C-2]
# 4. Build compile script base on list.lst [C-3]
# compile /phx/src/abc.p save into /phx/image.
# 5. After UAT, all Programs copy to phx/migration/<directory>
# 6. Code Migration team
# a. rcp *.tar From UAT server to LIVE server
# b. pkunzip
# c. run C-1,C-2 and C-3 script
#
MDIR=/phx
#for i in $MDIR/{load,utility,src}
for i in $MDIR/load $MDIR/utility $MDIR/src
do
cd $i
find $i ! -type d
done
#
# build pkzip
# build backup and move script
# build compile script