glitch003
12-03-2002, 07:17 PM
ok heres my question: i wanna make a program in perl(BTW im just learning perl) that just sends commands to the console. but heres the problem: say i type "ls". it gives me the contents of the root folder(my home folder). so then i type "cd .." and hit enter. then i type "ls". it still gives me the contents of the root folder. if i type "cd ..; ls" then it will display the contents of the / folder, like i want. all i want to use this program for is for making shortcuts, with if statements(ex. "droot" to set my current dir to root). please help and tell me why it does this. code is below:
#!/usr/bin/perl
print "CCOS1.00: ";
while ($input = <STDIN>){
system ("$input");
print "CCOS1.00: ";
}
#!/usr/bin/perl
print "CCOS1.00: ";
while ($input = <STDIN>){
system ("$input");
print "CCOS1.00: ";
}