- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- About the shell script
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
Forums
Discussions
Discussions
Discussions
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
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
11-04-2003 05:12 PM
11-04-2003 05:12 PM
About the shell script
I have a script which can compile a file ( eg. file1.cdr ) , the compiled file is .cbt extension ( eg. file1.cbt ) , how can I mv the compiled file (file1.cbt not file.cdr.cbt ) to the other path ( from /tmp to /usr) ? thx.
$pwd
/tmp
$my_script file1.cdr
$pwd
/usr
$file1.cbt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2003 05:16 PM
11-04-2003 05:16 PM
Re: About the shell script
FILE=`basename $1 .cdr"
compile $1
mv /tmp/$FILE.cbt /usr
This assumes you start the script with something like
myscript myfile.cdir
Also, the "compile" bit is where you do your compile with whatever command you use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2003 05:38 PM
11-04-2003 05:38 PM
Re: About the shell script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2003 06:15 PM
11-04-2003 06:15 PM
Re: About the shell script
but I still have a problem , I don't know why even the program can't be compiled ( some compile error gerenated ), it still report the result is "0" , so it is not work to use the error checking function " if [ $? -eq 0 ] then .. " , could suggest is there other method to make sure the file will be copy only when the compilation is successful ? thx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2003 06:30 PM
11-04-2003 06:30 PM
Re: About the shell script
You'll have to find out in the script, the same way as you do yourself. If the compile produced an error somewhere you'll have to look for it. As an example, suppose the compile writes lots of stuff to the screen and then "ERROR, it didn't work too well" if there is a failure. You would do something like this
your_compile_command > /tmp/compile.log
grep ERROR /tmp/compile.log > /dev/null || {
your_copy_commands here
exit
}
echo "Couldn't copy because the compile broke again"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2003 01:29 PM
11-05-2003 01:29 PM
Re: About the shell script
the system will not generate the word "ERROR" , it will generate different words , not exactly the same , do you have other idea ? thx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2003 04:03 PM
11-05-2003 04:03 PM
Re: About the shell script
You could try it the other way around. If it produces no output if it is successful then you you could test for success (nothing in the log) instead of failure (something in the log). Otherwise, I don't think there is much you are going to be able to do.