I have updated N.S.F. - New Script File to version 3.00 (works with openSUSE 12.3) It has the option to add a GPL statement to your script file and Version 3.xx now resides in the folder /usr/local/bin in order to use both KDE & GNOME icon files for easy GUI startup. This requires you use the root password in order to install this bash script version. If you like to share your scripts with others, you may want to think about including a GPL statement. It makes it clear that there is no warranty included with your script even as anyone is free to use and modify your script as they so desire. You still maintain a copyright on your original work, should that be required for something in the future. Keep using version 2.xx if you do not have root authority on your system to install nsf in the folder /usr/local/bin.
NSF (New Script File) version 3.xx has the following features …
- NSF assists you in creating a new and or editing an existing bash script file.
- NSF uses a GUI question and answer window in your desktop for the file name, no need to open up a terminal session.
- NSF asks if this is an existing or new bash script.
- If the script is existing, a file selection Windows will be displayed for the existing file selection.
- If new, NSF asks for the name of the script file you wish to create, but if it already exists, you can still just edit the existing file.
- Existing bash script files will have a backup file made for you, just in case you need it.
- Your new script file will receive a header and footer, which you can modify in NSF.
- Your new script file will be marked Executable for you.
- As you save your bash script file, you do not need to close the editor. Just open a Terminal session, type the script file name and see if it works.
- Auto Detection of zenity and kdialog made for you which you can override.
- Allows the addition of a GPL statement to make clear the use of your script should it be released to the public.
New features with 3.xx include:
- New Backup Folder Support for all Backups.
- All Backups are now moved to your selected Backup folder each time you run nsf
- The GPL Copyright Year is Automatically set to the present Year.
- Creates both KDE & GNOME icons in the Applications menu and on the Desktop.
- The new folder location of /usr/local/bin for the NSF bash script now allows it to be usable by all Linux users on your PC!
- When you start nsf you will be asked if you wish to edit an existing file:
http://thumbnails44.imagebam.com/16590/abeda3165895169.jpg](http://www.imagebam.com/image/abeda3165895169)
- If you answer yes, then you must select the existing script file:
http://thumbnails45.imagebam.com/16590/baa832165895172.jpg](http://www.imagebam.com/image/baa832165895172)
- Here is the New Script File GUI Name Request:
http://thumbnails12.imagebam.com/14047/88f2b6140464202.jpg](http://www.imagebam.com/image/88f2b6140464202)
- Here is the GPL GUI statement inclusion request:
http://thumbnails30.imagebam.com/14047/5860f5140464198.jpg](http://www.imagebam.com/image/5860f5140464198)
- Should the script file already exist, here is the GUI request to edit anyway:
http://thumbnails44.imagebam.com/14047/de1cdf140464201.jpg](http://www.imagebam.com/image/de1cdf140464201)
To use the bash script file nsf, you need to download the following text from SUSE Paste (Actual Link is shown below) into a text editor like kwrite:
N.S.F. - New Script File, Bash Script File Header Creator - Version 3.00
Save the text as root in the folder /usr/local/bin as the file named nsf.
If you have been using an older 2.xx or 1.xx version of nsf, execute this command before you download and use the new 3.xx version:
rm $HOME/bin/nsf ; rm $HOME/Desktop/NSF.desktop
It is possible to directly download this script from a terminal session (You must delete or rename the older 3.xx version first if it exists):
sudo rm /usr/local/bin/nsf
sudo wget -nc http://paste.opensuse.org/view/download/27761727 -O /usr/local/bin/nsf
This script must be marked executable to be used. Please run the following Terminal command:
sudo chmod +x /usr/local/bin/nsf
It is even possible to string all three of these commands together as one. I HIGHLY RECOMMEND you use this method to install nsf. Copy the following command, open up a terminal session, paste it in and press enter:
sudo rm /usr/local/bin/nsf ; sudo wget -nc http://paste.opensuse.org/view/download/27761727 -O /usr/local/bin/nsf ; sudo chmod +x /usr/local/bin/nsf
If you DO NOT HAVE ROOT Authority on your PC, use the following command for the older nsf 2.81 version ONLY:
rm ~/bin/nsf ; wget -nc http://paste.opensuse.org/view/download/51163610 -O ~/bin/nsf ; chmod +x ~/bin/nsf
In the script, there are several lines you might want to edit. The first is to use your name as the script file editor. Modify the script line that says:
# **Place Your Name Here as the script file author **
AUTHOR="Your_Names_Here"
# **Place Your Email Address Here **
email="Your_Name@SomeWhere.com"
# **Location For Your Script Files to be saved **
FOLDER="$HOME/bin"
# **Determine if you want a backup file made for existing scripts. **
# **Just set to false if you do not want this backup file made.**
BACKUP=true
BACKUP_FOLDER="$FOLDER/Backup"
# **nsf can create a kde/gnome icon if you want. nsf_icon_check=true creates an**
#** icon if not there for the KDE desktop. nsf_icon_check=false does not create a **
# **desktop icon. The KDE icon is located/named $HOME/Desktop/NSF.desktop.**
nsf_icon_check=true
#** nsf can create a kde/gnome menu icon if you want. nsf_appl_check=true creates
**#** an appl menu if not there. nsf_appl_check=false does not create a appl menu
**# **icon. The nsf_icon_check=true above must be set before an Application menu
**#** is create located/named as /usr/share/applications/NSF.desktop.**
nsf_appl_check=true
# **KDE/GNOME Desktop icon name**
de_icon_name="NSF.desktop"
# K**DE Desktop icon Location/Name - Look for it in your desktop folder **
nsfdeicon="$HOME/Desktop/$de_icon_name"
# **KDE/GNOME Menu icon Location/Name - Look for it in your Applications menu **
nsfdeappicon="/usr/share/applications/$de_icon_name"
N.S.F. will now create a desktop icon if the script value sysiconcheck=true is set (which you can set to false), you have a folder called ~/Desktop & the N.S.F> icon is not already there for you to use.
Running the nsf.desktop icon from your desktop would create an executable script file called myscript (in this example) and once kwrite opens it up, you would see something like the following information which you can then edit as your new script:
#!/bin/bash
#: Title : myscript
#: Date Created: Sat Dec 22 12:43:15 CST 2012
#: Last Edit : Sat Dec 22 12:43:15 CST 2012
#: Author : Your_Names_Here
#: Version : 1.00
#: Description :
#: Options :
#
# This is the standard GPL Statement, leave at the top of the script.
# Just use the command show_gpl after this function for it to be shown.
#
function show_gpl {
echo ""
echo "myscript is a bash script file written to be used with openSUSE."
echo "Copyright (C) 2012 by Your_Names_Here, Your_Name@SomeWhere.com"
echo ""
echo "This program is free software; you can redistribute it and/or modify"
echo "it under the terms of the GNU General Public License as published by"
echo "the Free Software Foundation; either version 2 of the License, or"
echo "(at your option) any later version."
echo ""
echo "This program is distributed in the hope that it will be useful,"
echo "but WITHOUT ANY WARRANTY; without even the implied warranty of"
echo "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"
echo "GNU General Public License for more details."
echo ""
echo "You should have received a copy of the GNU General Public License"
echo "along with this program; if not, write to the Free Software"
echo "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"
echo ""
}
exit 0
# End Of Script
As always, I would love to hear any comments you have about using the script file creator script.
Thank You,
Blogs:](http://forums.opensuse.org/blogs/jdmcdaniel3/sysedit-system-file-editor-version-1-00-60/) C.F.U. : N.S.F. : S.A.K.C. : MMCHECK : S.C.L.U. : S.G.T.B. : S.K.I.M. : S.L.A.V.E.](http://forums.opensuse.org/blogs/jdmcdaniel3/sysedit-system-file-editor-version-1-00-60/)