Using awk variables for regular expressions is working for me in AIX. It is failing for me in SunOS. I don't know why. Can someone explain and/or suggest a fix for the SunOS version?
Here is a little test script. It runs fine in AIX:
Code:
$ cat test.ksh
#!
Hello Everyone,
This 10th field is giving too much problem in AWK. How do i overcome ?
Hello,
I'm a bit stumped, for some reason when using AWK 'print' is not printing the entire date/line.
Folks,
I am working on a file which has entries as follows.
Hi!
I have in bash script the following line:
Code:
TMP1=`echo $TMPO | awk '{FS=", "} {for (i = 1; i <= NF; i++) print $i}' | sort -z`
which sorts words within string, echo $TMP1 shows that everything is OK, but when i try to :
Hi,
i find this really useful, i am runing several laptops with ubuntu and using this on all of them.
Just add following code to your ~/.bashrc and it should work it require acpi package
Code:
# Battery status for bashrc
# Orginaly produced by Fabio 'farnis' in 2003
# Modified by Bacil in 2009
Hi ,
i have problem with awk variable. I am able to get variable for $pname and $powner when i tried to echo them. However i keep having syntax error in "print owner1" , and FYI this is my first time to assign 2 variable in 1 awk line. Any comment? thanks!
Source file sample
Code:
/abc patrick
/cdf John
/ghi Colin
My Code
Hi
pls tell me how to print a print triangle as below
Code:
0
101
21012
i am able to print triangle as below
Code:
0
1 0
2 1 0
3 2 1 0
4 3 2 1 0
5 4 3 2 1 0
6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
8 7 6 5 4 3 2 1 0
9 8 7 6 5 4 3 2 1 0
the script which i used for above o/p is mention as below
Code:
#!/bin/ksh
x=0
while [ "$x&quo
Hi,
I am in a situation to print the message on a column, where the each line starting position should be same.
For example code:
Code:
HOSTNAME1="1.2.3.4.5.6.7"
TARGET_DIR="/tmp"
echo "HOSTNAME1:" "$HOSTNAME1" | awk -v var="Everyone" '{len=55-length;printf("%s%*s\n",$0,len,var)}'
echo "TARGET_DIR:" "$