Hi Experts,
I am trying to get the output from a matching pattern but unable to construct the awk command:
file :
Code:
aa bb cc 11
dd aa cc 33
cc 22 45 68
aa 33 44 44
dd aa cc 37
aa 33 44 67
I want the output to be : ( if $1 match to "aa" start of the line,then print $4 of that line, and if $1 matches to "dd" of start of that line then print $4 of that line)
Hi.
I need to parse file and assign some values to variables, right now i do like below
Code:
MYHOMEDIR=`awk '/Home/ {print $NF}' output.txt`
MYSHELL=`awk '/Shell/ {print $NF}' output.txt`
PRGRP=`awk '/Primary/ {print $NF}' output.txt`
SECGRP=`awk '/Second/ {print $NF}' output.txt`
In this case, AFAIK, output.txt is being opened 4 times.
Following this thread:
http://www.unix.com/ip-networking/19...-ftp-task.html
I have created the following script:
Code:
#!
Try print something from Firefox with "print to file", no matter which destination is chosen to print to (say Desktop) the output always end up in Home/username.
Hi,
My input file as follws
$ cat 1.txt
-------
Code:
a aa aaa 11
b bb bbb 22
I am able to extract first and last column of a given line as follows.
Code:
$ nawk '{print $1}' FS= RS= 1.txt | awk '{ $NF = ""; print }'
a
Code:
$ nawk '{print $1}' FS= RS= 1.txt | awk '{ print $NF}'
11
however, the same is not working by using shell script.
Hello Friends,
I have a CDR file and i need to print out 2 columns with their field position which matches to some constant values,
a part of input file
Code:
CZ=1|CZA=1|DIAL=415483420001|EE=13|ESF=1|ET=[16/04/2012][10:44:46:435]|FF=0|9|MNC=99|MNP=9041|MTC=0|NID=2|NOA=international|ON=1|
Code:
OutPut
3,DIAL=415483420001|13,NOA=international
i need to print out the colums wh
Hello all, I am working on a python script and this is what i have
Code:
from sys import argv
script, filename = argv
print "We're going to erase %r " % filename
print "If you don't want that, hit Ctrl -C (^C)."
print "If you do want that, hit RETURN."
raw_input("?")
print "Opening the file..."
target = open(filename, 'w')
print "Tr
this may be basic thing for everyone here, but i cant push awk to print the variable user input which is INS, please help.
code:
Code:
INS=$1
printf '\n'
symdg list | grep $INS-clone | awk -v i=$INS '{ID=substr($4,9,4)}{print "Device Group: "$1,"at Array "ID,i}'
output:
Code:
$ ./test.sh patty
awk: syntax error near line 1
awk: bailing out near line 1
Hi,
Below is starting entry of my script
#!/bin/ksh
Usage()
{
print "Usage: $0 ID OPTION SERVER"
print "<br>Where :"
print "<br>Enter your ID into PARAM1, OPTION in the PARAM2 and SERVER in the PARAM3 field"
print "<br>ID should be a valid ID"
print "<br>OPTION should be either BOUNCE or STATUS"
print &q