Lieber Besucher, herzlich willkommen bei: GentooForum.de. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.
Quellcode |
|
1 2 3 4 5 6 7 |
#!/bin/bash if [$schalter == "n"] then (umwandlungs- script von nef zu jpg) else (umwandlungs-script von jpg zu gif) fi |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
(Bsp. von der Sseite: you@host > read vorname nachname Jürgen Wolf you@host > echo $vorname Jürgen you@host > echo $nachname Wolf you@host > read vorname nachname Jürgen Wolf und noch mehr Text you@host > echo $vorname Jürgen you@host > echo $nachname Wolf und noch mehr Text) |
Quellcode |
|
1 |
/meinscript n bild1.tff |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Schattenschlag« (07.10.2014, 13:42)
Quellcode |
|
1 2 3 |
cd .local/share/nautilus/scripts/Bilder_umwandeln chmod +x _convert_ bash _convert_ |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
#!/bin/bash ## Script zum umwandeln von Bildern in ein anderes Format IFS=$'\n' cd $PWD ## Erstelle Symbolische Links if [[ "${0##*/}" == "_convert_" ]]; then for LinkFile in jpg tif eps2 do test -L $LinkFile || ln -s _convert_ $LinkFile done exit fi ## Umwandeln der/des Bilder/s for Input in $@ do ## erstelle Liste mit Bildern if [[ -d "$PWD/$Input" ]]; then ImageList="$PWD/$Input/*" else ImageList="${Input}" fi ## umwandeln der Bilder for Image in ${ImageList} do if [[ -f "$Image" ]]; then convert "${Image}" ${0##*/}:"${Image::-4}.${0##*/}" >> $HOME/test.temp fi done done |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 |
if (ls *.nef) > /dev/null 2>&1 then dcraw -e *.nef # mogrify -format jpg *.nef rename ".thumb" "" * for i in *.jpg; do mv "$i" "`basename $i thumb.jpg`-nef.jpg"; done mv *.jpg \jpg rm *.nef fi echo "nef ok" |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Beispiel: ./DeinScript jpg2nef Bild1 Bild2 .... case $1 in jpg2nef) shift for jpgBild in $@ do wandel ${jpgBild} in nef um done ;; nef2jpg) shift machs andersrum ;; esac |
Quellcode |
|
1 2 3 4 5 6 7 8 |
#!/bin/bash read -p " Was möchten sie tun "$1 $2 if ( test "${1}" == "B" ) then echo @2 | perl -lpe '$_=join " ", unpack"(B8)*"' else echo @2 | perl -lape '$_=pack"(B8)*",@F' fi |
Quellcode |
|
1 2 3 4 5 6 7 8 |
#!/bin/bash read -p " Was möchten sie tun " var1 var2 if [[ "${var1}" == "B" ]]; then echo @2 | perl -lpe '$_=join " ", unpack"(B8)*"' else echo @2 | perl -lape '$_=pack"(B8)*",@F' fi |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
#!/bin/bash # arguments MODE="" SRC_FILE="" DST_FILE="" while [ "${1}" != "" ]; do # deal with the options case "${1}" in -x|--krass) MODE="krass" ;; -h|--help) echo "This is here is the help/usage page." echo echo "USAGE:" $(basename ${0}) "[OPTION] SRC_FILE DST_FILE" echo echo "with OPTION been:" echo " -h|--help this page" echo " -x|--krass real krasse option" echo echo "This program will do krass stuff with your files." echo echo " - SRC_FILE source file" echo " - DST_FILE destination file (existing ones will be destroyed)" exit 0 ;; -*|--*) echo "Unknown option: ${1}" echo "Huh? o.O -- type '--help' for help." exit 1 ;; *) break ;; esac shift done # get the files SRC_FILE="${1}" DST_FILE="${2}" # sanity checks if [ -z "${SRC_FILE}" ]; then echo "No source given. Bailing out." echo "Type --help for help." exit 1 fi if [ -z "${DST_FILE}" ]; then echo "No destination given. Bailing out." echo "Type --help for help." exit 1 fi # option? if [ "${MODE}" == "krass" ]; then echo "Echt krasse option activated." echo "PROGRAMM SUPER-OPTIONS" ${SRC_FILE} ${DST_FILE} else echo "No krasse option activated - lame." echo "PROGRAMM LAME-OPTIONS" ${SRC_FILE} ${DST_FILE} fi |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 |
$ ./do_krass.sh foo bar No krasse option activated - lame. PROGRAMM LAME-OPTIONS foo bar $ ./do_krass.sh -x foo bar Echt krasse option activated. PROGRAMM SUPER-OPTIONS foo bar $ ./do_krass.sh --krass foo bar Echt krasse option activated. PROGRAMM SUPER-OPTIONS foo bar |