My first shell script: run jar files on right click

Posted on 2005-11-01 17:19 罗明 阅读(446) 评论(0)  编辑  收藏 所属分类: Operating System
Yesterday i learned a little about shell script, and have an idea of writing a script for running a Java jar file on right click. It's simple and easy to understand. Hmmm... a good start.
 
Copy following text into a file named "runJar"(maybe another name you like ^_^), put the file in ~/.gnome2/nautilus-scripts/ directory(~ is your home directory), after that, when you right click on a jar file, you can run it via [scripts -> runJar]. Hope it will be usefull for java guys.
 
#!/bin/bash
#
# Nautilus script -> execute a jar
#
# Owner : Andy Luo
#      andyluo197(AT)gmail.com
#      http://www.blogjava.net/andyluo
#
# Licence : GNU GPL
#
# Copyright (C) Andyluo
#
# Ver. 0.1-1 Date: 10/31/2005
# Execute a jar file.
#
# Ver: 0.1  Date: 10/31/2005
# Initial release
#
# Dependence : JRE
#
for arg
do
$(java -jar "$arg")
done


版权所有 罗明

标题  
姓名  
主页
验证码 *  
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2006-10-08 22:31 编辑过