Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FOR - Schleife in der Shell

Empfohlene Antworten

Veröffentlicht

Guten Tag,

ich benötige dringend hilfe und hoffe das mir hier jemand weiterhelfen kann. Und zwar hab ich eine FOR-Schleife in ein Batch File geschrieben das eine Datei kopiert und fortlaufend ein neues Verzeichnis und Dateinnamen erstellt.

Hier meine Syntax:

@echo off

FOR /L %%a IN (1,1,3) DO xcopy D:\VM\Ubuntu\Ubuntu.vdi D:\VM\%%a\%%a.vdi /W /E /H /N /I

PAUSE

Nur brauche ich diese Syntax nicht für eine Batch Datei sonder für die Shell in Linux(Hab überhaupt kein Plan von Linux). Kann mir jemand helfen wie ich das für die Shell umschreiben kann.

Vielen dank im vorraus.

  • 3 Wochen später...

Falls jemand das gleiche Problem hat und die Lösung gebrauchen könnte!

#!/bin/bash

#Bitte vor Benutzung anpassen!

vmPath=/home/vadmin/Desktop

vmFile=testfile.txt

username=vadmin

copies=3;


while [[ "$WISH" != "y" && "$WISH" != "n" ]]

do

echo "Do u want to start the copy process? [y]es [n]o"

read WISH

echo

done


if [ "$WISH" = "y" ]; then

echo "Starting copy process..."

for (( i = 1; i < copies+1; i++ ))

do


if [ ! -d $vmPath/$i ]; then

mkdir $vmPath/$i

chmod -R 755 $vmPath/$i

fi


cp $vmPath/$vmFile /home/vadmin/Desktop/$i/$i.txt

chmod 755 $vmPath/$i/$i.txt

chown -R $username /$vmPath


#remove uuid and MAC

#vmkfstools aufrufen: ./user/sbin/vmkfstools


done

fi


if [ "$WISH" = "n" ]; then

echo "Aborting operation..."

exit

fi

 

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.