- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script not executing properly ???
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2004 08:08 PM
тАО07-02-2004 08:08 PM
script not executing properly ???
I attached one script for very basic copying to files with certain conditions.
First condition is ok but after it is not executing further.
If disable the second condition then also it is not copying the files.
Help me in this case.
Explain me details please.
Thanks in advance.
Shan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2004 08:23 PM
тАО07-02-2004 08:23 PM
Re: script not executing properly ???
==========================
# condition 6
if [ "ANSWER" = "yes" ] # <<<<< Change to $ANSWER
then
cp $1 $2
echo "file copied"
exit 0
==========================
It should be
=========================
# condition 6
if [ "$ANSWER" = "yes" ] # <<<<< Change to $ANSWER
then
cp $1 $2
echo "file copied"
exit 0
====================
Regds,
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2004 08:57 PM
тАО07-02-2004 08:57 PM
Re: script not executing properly ???
set -x
./script file1 file2
Regds,
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2004 10:57 PM
тАО07-02-2004 10:57 PM
Re: script not executing properly ???
Are you using the echo without messages for debugging. If so use set -x or set -v for that.
set -x - it will give messages after command execution
set -v - it will give the comman messages before execution.
Change the if [ "ANSWER" = "yes" ] as
if [ "$ANSWER" = "yes" ]
change this echo "file copied with " at end.
Regards,
Muthukumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2004 01:43 AM
тАО07-03-2004 01:43 AM
Re: script not executing properly ???
check if there are two args if not exit
condition 2 :-
check if both the args are the same. if same exit
condition 3 :-
check source file is a normal file. if not exit
condition 4 :-
check if source file is readable
condition 5 :-
check if the file already exist. if exist check with the user if he wants to over write.
condition 6 :-
check user's input is "yes". if yes copy the file else quit ..
Regds,
Kaps
check this thread as well.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=140137
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2004 01:55 AM
тАО07-03-2004 01:55 AM
Re: script not executing properly ???
my first command line arg is a file having no permission. but script is excuting properly
How?
Ans :-
Are running it as root ?
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2004 02:15 AM
тАО07-03-2004 02:15 AM
Re: script not executing properly ???
Thanks,