Quicklinks

EndUser

Test/Virtualisaton


Installieren

Kernel - Tuning

Network

Display / Pads

Bock Devices

Printer

USB-Devices

BenutzerSW

Server

Install Notes

General/Hints

anoyances.org

Collection of installation & troublshooting info related to my linux (debian/mint/ubuntu) installations

Kat: Bash Tools

Sehr einfache Scripts

  1. Hyperword-Script - liest Clipboard, und fuehrt den editierten String aus.
  2. String ausführen - Workarround um von Gnome-Starter mehrere Befehle ausführen zu können

1 "Hyperword" Script

Das Script kann aus einem Gnome-starter aufgerufen werden
Ein Fenster mit dem Clipboard poppt auf, der Inhalt kann abgeaendert und mit "o.k" als Befehl ausgeführt werden.

Testbefehl:
sudo route add default gw 192.168.0.1

#!/bin/bash
# simple script to edit selected textaereas 
# string in the box can be modified and will be executed locally by click YES
# xclip must be installed - (Debian, Ubuntu: apt-get install xclip   )
#
# Autor: Patrick Ogay - GPL 

##  Beginning of Procedure ls -ali  less /etc/fstab
#cmd=$(`xclip -o;`)
cmdraw=`xclip -o;`

cmd=$(zenity --entry --title=Befehls Clipboard --entry-text="$cmdraw" STRING --text="String can be modified");
echo "clip=/$cmd/"
bash -c "$cmd";

# top keep window open when starte from gnome starter (otherwise read is o.k.) 
if ! zenity --notification --text "leave"; then 
  exit;
fi
exit

2 Mehrer Befehle aufführen, an Orten, wo man nur einen ausführen kann.

#!/bin/bash 
# aufgerufen als Gnome-Panel 
# Commandstrings mit ;
echo "command:  $1"
bash -xv -c "$1"

# wenn aus Gnomepanel gestartet
if ! NAME=$(zenity --entry --text "sonst geht Console zu" --title "Enter"); then
  exit;
fi

Edit Page - Page History - Printable View - Recent Changes - WikiHelp - SearchWiki
Page last modified on August 15, 2009, at 09:00 AM, visited:$PageCount