Eingabebefehl

Hi,
ich würde gerne wissen wie ich in Batch eine Tastatureingabe ini eine Variable einlesen kann,
also sowas wie in C++ der Cin Befehl.
Kann mir jemand helfen?
 
Hi @ll,

ich denke ich weiß was du willst, habe das selbe Problem!!!
Achtung: der nachfolgende Quelltext funzt nit!!!!!!!!!!!!!!!!!!


Code:
//-----------------------------------------------------------------------------
#include <iostream>
#include <conio>
#include <iomanip>
using namespace std;
//-----------------------------------------------------------------------------
void nerv(int, int);

int main()
{
  int Raum, Computer;
  cout<<fixed<<setprecision(2)<<endl;;
  cout<<"Ein Programm ... :)"<<endl;
  cout<<"***********************************************************************"<<endl<<endl;
  cout<<"Raum: C";
  cin>>Raum;
  cout<<"Computer: c";
  cin>>Computer;
  cout<<endl;
  cout<<"***********************************************************************"<<endl<<endl;
  nerv(Raum, Computer);

  getch();
  return 0;
}
//-----------------------------------------------------------------------------

void nerv(int Raum, int Computer)
{
  cout<<"please wait ..."<<endl;
  system(" -m \\C"<<Raum<<"c"<<Computer);//befehl unvollständig
  //dat funzt aber nit, ebenso "system(" -m \\C%ic%i), Raum, Computer;"
}

Auch wenn der Befehl vollständig is funzt es nit!!!!!! ;)
Jesuz meinst du das selbe???

mfg Shark85
 
Moin,

meinst du mit Batch, aus einem Shell-Script heraus?

Das wäre dann folgendes:

-----------------------(cut)---------------------
#!/bin/bash
echo "Bitte Eingabe:"
read A
echo "Eingabe war "$A
-----------------------(cut)---------------------
 
Zurück
Oben