Search Results

Search: Posts Made By: Lotheovian
3,110
Posted By Lotheovian
Expect and variables
I'm trying to make an expect function that will pass through a variable.


/usr/bin/expect<<EOD
spawn su -
expect "Password: "
send "$psswd\r"
expect "#"
send "/etc/init.d/network restart...
3
1,396
Posted By Lotheovian
Here is the response from my Cent 6.2 box. ...
Here is the response from my Cent 6.2 box.

[Lothy@Z1 ~]$ ./expect.tst
spawn su - root service cups restart
Password: missing "
while executing
"send "password123\n
"
(file...
3
1,396
Posted By Lotheovian
Expect
I'm currently trying to use the expect command in a script to login as root on my Cent box. I have got it working on my Ubuntu box earlier but can not seem to get it working again. I've been on...
3,337
Posted By Lotheovian
root@bt:~# inet=$(ifconfig eth0 |grep "inet addr"...
root@bt:~# inet=$(ifconfig eth0 |grep "inet addr" |awk -F":" '{print$2}'|awk -F"." '{print $1"."$2"."$3}')
root@bt:~# echo $inet
192.168.0

I've just started using awk. At the moment I only know...
3,337
Posted By Lotheovian
I'm trying to trim off that last octet so I can...
I'm trying to trim off that last octet so I can input the variable inet.* and run a nmap on specific ports.

---------- Post updated at 09:48 PM ---------- Previous update was at 09:46 PM...
3,337
Posted By Lotheovian
root@bt:~# ifconfig eth0 |grep "inet addr" |awk...
root@bt:~# ifconfig eth0 |grep "inet addr" |awk -F":" '{print$2}'|awk -F"." '{print $1"."$2"."$3}'
192.168.0
root@bt:~# inet=$?
root@bt:~# echo "$inet"
0


my head is going to explode
...
3,337
Posted By Lotheovian
Awk/grep
Basically what I'm trying to do is pull the first three octets from the ipaddr out of ifconfig

ifconfig eth0 |awk -F" " '{ print $2 }'|grep addr: |awk -F":" '{ print $2 }'| awk -F"." '{print...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 09:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy