Notices


Reply
Thread Tools
Posts: 24 | Thanked: 9 times | Joined on Nov 2010 @ Penang/Malaysia
#1
This simple script is to help those using alot of .sh scripts.
It practically just convert it into commands for easy usage

Here is the download link
http://www.4shared.com/file/XSLdoyE8/cmdmaker.html

Copy the script to /root

Then launch xterm and type the following codes
Code:
root
chmod a+x ./cmdmaker.sh
cp ./cmdmaker.sh /usr/bin/cmdmaker
cmdmaker
Any queries are welcomed
Thanks
__________________
My blog
MY BLOG
--My brain lights up best in the toilet--

Last edited by pang; 2011-01-23 at 13:21.
 

The Following 3 Users Say Thank You to pang For This Useful Post:
debernardis's Avatar
Posts: 2,142 | Thanked: 2,054 times | Joined on Dec 2006 @ Sicily
#2
Your script is:
Code:
#!/bin/sh
echo "Thanks for using this script. Copyright 2011 Pang Zi Yang"
echo "This script enables you to change .sh scripts into commands for easy usage"
find /home/user/MyDocs/ -name \*.sh
echo "Please enter name of the script you want to convert into command"
echo "Don't need to enter /home/user/MyDocs/"
read scriptlocation
echo "Please enter the name of the command"
read commandname
chmod a+x /home/user/MyDocs/$scriptlocation | echo "Please hold on"
cp /home/user/MyDocs/$scriptlocation /usr/bin/$commandname | echo "Done"
# cmdmaker.sh
# 
#
# Created by Pang Zi Yang on 1/19/11.
# Copyright 2011 Pang. All rights reserved.
Well, the Copyright note is funny. You are reserving your rights on copying a file from a directory to another and changing the permissions, aren't you?
__________________
Ernesto de Bernardis

 

The Following 2 Users Say Thank You to debernardis For This Useful Post:
Posts: 671 | Thanked: 1,630 times | Joined on Aug 2010
#3
Originally Posted by debernardis View Post
Your script is:
Code:
#!/bin/sh
echo "Thanks for using this script. Copyright 2011 Pang Zi Yang"
echo "This script enables you to change .sh scripts into commands for easy usage"
find /home/user/MyDocs/ -name \*.sh
echo "Please enter name of the script you want to convert into command"
echo "Don't need to enter /home/user/MyDocs/"
read scriptlocation
echo "Please enter the name of the command"
read commandname
chmod a+x /home/user/MyDocs/$scriptlocation | echo "Please hold on"
cp /home/user/MyDocs/$scriptlocation /usr/bin/$commandname | echo "Done"
# cmdmaker.sh
# 
#
# Created by Pang Zi Yang on 1/19/11.
# Copyright 2011 Pang. All rights reserved.
Well, the Copyright note is funny. You are reserving your rights on copying a file from a directory to another and changing the permissions, aren't you?
Expect a visit shortly from some thugs in Micro$oft uniforms
escorting a flock of lawyers....
__________________
Three n900s: One for stable working platform,
One for development testing Chopping Onions
One for saltwater immersion power testing resurrected ! parts scavenging

My Mods for Wonko's Advanced Clock Plugin:
ISO8601 clock mod and Momental_IST clock mod

Printing your Email with the N900
 
Posts: 24 | Thanked: 9 times | Joined on Nov 2010 @ Penang/Malaysia
#4
Sorry about the copyrights thing..
I wrote it in xcode..
Will change it now..
Thanks
---EDIT--
was in a hurry posting this up..
the file has been changed
__________________
My blog
MY BLOG
--My brain lights up best in the toilet--

Last edited by pang; 2011-01-23 at 13:19.
 

The Following User Says Thank You to pang For This Useful Post:
hawaii's Avatar
Posts: 1,030 | Thanked: 792 times | Joined on Jun 2009
#5
...

So let me get this straight..

1). You're setting a mode within a vFAT partition before moving it to an ext3 node.
2). You're copying that entire script/binary into a size-constrained file system (rootfs) instead of one sitting in the optfs.
3). You felt the need to copyright a script that uses GNU userland tools.

Did I get it all?
 

The Following User Says Thank You to hawaii For This Useful Post:
Posts: 36 | Thanked: 28 times | Joined on Jul 2010
#6
Code:
echo export PATH=$PATH:/home/user >> .bash_profile # Copyright 2011 dave1010
 
Posts: 539 | Thanked: 165 times | Joined on Feb 2010 @ Berlin, Germany
#7
Really funny thing that script (weird kind of humour you have)

Some ideas for improvement:
  • don't copy script file but create a symlink to it
  • create that link (or put the copy) in /home/user/bin, as /usr/bin is for system binaries and not for own created files. In FSH the correct place would be /usr/local/bin but that's not handled correctly by Nokia.
  • add /home/user/bin to $PATH (needs editing some login script)
  • test if command already exists and prompt user for confirmation if it does
  • do some error handling
Besides that, some nice idea.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 19:37.