Search Results

Search: Posts Made By: lee.n.doan
1,236
Posted By Scrutinizer
Hi, you need to double quote $2 as well,...
Hi, you need to double quote $2 as well, otherwise the * will get expanded by the shell.

You can also use a case statement, then you do not need to quote the variable
case $2 in
\*|+|-|/) ...
4,320
Posted By vgersh99
-F '[ =.]' makes space/=/. as field separators. ...
-F '[ =.]' makes space/=/. as field separators.
NF - NumberofFields

12.12.52.125.in-addr.arpa name = hostname.domain.main.gov

'gov' - last field (NF)
'main' - next to last field...
4,320
Posted By vgersh99
echo "12.12.52.125.in-addr.arpa name =...
echo "12.12.52.125.in-addr.arpa name = hostname.domain.main.gov" | nawk -F'[ =.]' '{close(out);out=$(NF-2);print $(NF-3)>>out}'
4,320
Posted By palsevlohit_123
echo "12.12.52.125.in-addr.arpa name =...
echo "12.12.52.125.in-addr.arpa name = hostname.domain.main.gov" | awk -F"="
'{print $2}'
4,643
Posted By ctsgnb
-eq | equal -ne | not equal -gt | greater...
-eq | equal
-ne | not equal
-gt | greater than
-lt | less thandone is used to end a loop :

while [ condition ... ]
do
cmd1
cmd2
...
done


for i in $LIST
do
cmd1
cmd2
...
done
4,643
Posted By ctsgnb
#!/bin/sh addnumbers() { if [ $# -eq 2 ];...
#!/bin/sh

addnumbers()
{ if [ $# -eq 2 ]; then
#in this line space after "[" and before "]" are important! $# stand for the number of arguments
sum=`expr $1 + $2`
#in...
Showing results 1 to 6 of 6

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