Skip to content

Instantly share code, notes, and snippets.

filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
import subprocess
import shlex
p1 = subprocess.Popen(shlex.split("ifconfig wlan0"),stdout=subprocess.PIPE,stderr=subprocess.PIPE)
p2 = subprocess.Popen(shlex.split("awk '/inet addr:/ {print substr($2,6)}'"),stdin=p1.stdout,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
out, err = p2.communicate()
print "out:", out[:-1]
print repr(out[:-1])
#!/bin/bash
addresses=`cat addresses.txt`
while IFS= read -r ip
do
ssh user@"$ip" 'ls
cd /tmp
pwd
touch a
echo "merhaba" > a
cat a
192.168.1.3
192.168.1.2
#!/bin/bash
file_a=`cat $1`
file_b=`cat $2`
while IFS= read -r line_a
do
while IFS= read -r line_b
do
if [ "$line_a" != "$line_b" ];then
#echo "$line_a : $line_b"
echo "$line_b will be deleted"