Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- LAN_IP="192.168.1.1"
- LAN_MASK="255.255.255.0"
- LAN_GW="192.168.1.254"
- echo "hello world" | wc -w
- wc -w <<< "hello world"
- grep "dev" <<<`ls -1 /` >/dev/null && echo "Found" || echo "Not found"
- grep "windows" <<<`ls -1 /` >/dev/null && echo "Found" || echo "Not found"
- cat << EOF > /tmp/a
- allow-hotplug eth0
- iface eth0 inet static
- address $LAN_IP
- netmask $LAN_MASK
- gateway $LAN_GW
- EOF
- # je potreba escapovat, co se nema dosadit/vyhodnotit
- cat << EOF > /tmp/b
- allow-hotplug eth0
- iface eth0 inet static
- address $LAN_IP
- netmask $LAN_MASK
- gateway $LAN_GW
- dns-nameservers \$LAN_GW
- EOF
- # 'EOF' - apostrof zajisti nenahrazovani promennych
- cat << 'EOF' > /tmp/c
- allow-hotplug eth0
- iface eth0 inet static
- address $LAN_IP
- netmask $LAN_MASK
- gateway $LAN_GW
- EOF
- # <<- pomlcka dovoli cely oblok odsadit od zacatku radku, jinak musi byt EOF na prvnim sloupci
- cat <<- 'EOF' > /tmp/d
- allow-hotplug eth0
- iface eth0 inet static
- address $LAN_IP
- netmask $LAN_MASK
- gateway $LAN_GW
- EOF
- cat <<- EOF > /tmp/e
- allow-hotplug eth0
- iface eth0 inet static
- address $LAN_IP
- netmask $LAN_MASK
- gateway $LAN_GW
- EOF
- cat <<- KonecTextu > /tmp/f
- allow-hotplug eth0
- iface eth0 inet static
- address $LAN_IP
- netmask $LAN_MASK
- gateway $LAN_GW
- KonecTextu
Add Comment
Please, Sign In to add comment