Getting the current shell in a perl script
Hi,
I have the following function to get a shell and use the value to execute a
command.
$shell_type = `echo \$SHELL | awk -F/ '{print \$NF}'`;
print "Shell type is $shell_type";
`sudo -E $shell_type -c "/sbin/ifconfig eth0"`;
This prints the shell type as bash, but no output for ifconfig.
When I try to open the file again using vim, I get the following message:
Vim: Warning: Output is not to a terminal
What is wrong in the perl script?
Thanks,
D
|