Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Batch u Bash script

[es] :: Skript jezici :: Batch u Bash script

[ Pregleda: 2747 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

CyberHacker
Cyber Cop

Član broj: 162311
Poruke: 16
77.222.15.*



Profil

icon Batch u Bash script23.04.2008. u 20:35 - pre 193 meseci
Zdravo svima za moj kolokvijum u operativni sistem kreirao sam ovaj batch file za dos nije komplikovan a sad ako mozete da mi pomognete da kreiram jedan u bash

Code:
@echo off

echo .---------------------------------------------------------------------.

echo .       This Batch File is created by CyberHacker                     .

echo .  Istructions:                                                       .

echo . 1.The prompt will be at "C:\Temp>" because her is alowed as to work .

echo .                                                                     .

echo . 2.That means with thes program you cant create a folder in no one   .

echo .   different folder just in subdirectories of Temp.                  .

echo .                                                                     .

echo . 3.I have create this batch file just to training for my exam in     .

echo .   Operating Systems.                                                .

echo .                                                                     .

echo .                                                                     .

echo ._____________________________________________________________________.

echo .

pause

echo .

echo .

echo This program will create a directory with the name you chose.

echo If you chose Yes he will create the directory

echo If you chose No he wont create the directory

goto check



:check

echo Whould you create any folder

set pass=yes

set pass1=no

set/p "ent=>"

goto check1



:check1

if %ent%==%pass% goto folder

if %ent%==%pass1% goto exit

if not %ent%==%pass% goto inv

if not %ent%==%pass1% goto inv



:folder

echo Enter the destination were you would create the folder?

echo The prompt every time will be at "C:\Temp" just enter the subdirectory.

echo And the prompt will go there you have chose.

set/p "cc1=>"

cd %cc1%

echo You are in %cc1% directory.

echo Chose the name of your folder who you whant to create?

set/p "cc=>"

md %cc%

goto end



:inv

Echo You have enter invalid parameters enter Yes or No

set/p "ent=>"

goto check1



:exit

echo The folder is not created

goto cc





:end

echo You create succesfuly folder %cc%

pause

cls



:cc

echo This batch file is created by CyberHacker



pitanja su kako su komande u bash za

set
set/p
if
if not
%..%
==
kako da to ih pisujem u bash scripti i ako vam nije tesko kreratemi vi jedan bash script slican.
 
Odgovor na temu

CyberHacker
Cyber Cop

Član broj: 162311
Poruke: 16
85.94.121.*



Profil

icon Re: Batch u Bash script30.04.2008. u 19:10 - pre 193 meseci
vi niste me pomozili za ovaj zadatak pa ja sam mora da ucim iz engleski knjiga
eto ako nekome sluzi i ako imate vremena gledajte ga ako radi dobro

Code:

#!/bin/bash
echo Ovaj program ce kreirati jedan direktorium
echo ako hoces da kreiras neki direktorium pritisni Y ako ne N:
read d
e="y"

if [ "$d" == "$e" ]
then 
   echo Unesite ime direktoriuma u koji hocete da udjite:
   read l
     if [ -f $l ]
     then 
       echo "$"l nije direktorium.
       exit 1
     else 
       cd $l
       echo unesite ime direktoriuma koji zelite da ga kreirate:
       read k
         if [ -d $k ]
         then
            echo vec postoji jedan direktorium sa ime "$k".
            exit 1
         else
            mkdir $k
            echo Kreirali ste direktorium "$k" u direktorium "$l".
            exit 1
         fi
     fi
else 
   echo Unjeli ste N "ne" script se zaustavlja.
   exit 1
fi
 
Odgovor na temu

[es] :: Skript jezici :: Batch u Bash script

[ Pregleda: 2747 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.