10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
If i were to do this an print out the file, it will show as it is in the command
$ awk '/Privilege Use/ {P=0} /Object Access/ {P=1} P' AdvancedAudit.txt
Object Access
File System No Auditing
Registry No Auditing
Kernel... (1 Reply)
Discussion started by: alvinoo
1 Replies
2. Shell Programming and Scripting
Hi,
I need to set "prd" in the below command to a unix variable
nawk '/^#/ {next} FNR==NR {prd;next} !($0 in prd)'
So, this is what i did
fname=prd // unix shell variable
nawk -v fname=$fname '/^#/ {next} FNR==NR {fname;next} !($0 in fname)'But the value of fname i.e "prd" is not... (8 Replies)
Discussion started by: mohtashims
8 Replies
3. Shell Programming and Scripting
Hi All,
I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command.
The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Discussion started by: G.K.K
7 Replies
4. Shell Programming and Scripting
Hi,
I am doing an AWK in ksh as below with the string to search to be read from variable but for some reason there is no output. It works when I hard code it.
awk 'substr($0,22,6)=="${VAR}"' XXX.txt' >YYY.txt
On reading other posts I tried below option,
'substr($0,22,6)=="/"${VAR}/""'
... (3 Replies)
Discussion started by: junnujayz
3 Replies
5. Shell Programming and Scripting
Hi There,
I am writing a ksh script which assigns variable values from file "A" and passes that variables to file "B". While passing the parameters an additional "$" sign is being assigned to awk -v option.
Could any one help me with this please.
#!/bin/ksh
head -1... (3 Replies)
Discussion started by: Jeevanm
3 Replies
6. Shell Programming and Scripting
I have a large csv file that looks like this:
The 3rd field is a unix time stamp that I want to convert to human readable.
I wrote a bash script with this code:
IFS=$','
cat $1 | while read ID user DATE text flags read; do
echo -e "$ID,$user,$(date -d @$DATE),$text,$flags,$read... (3 Replies)
Discussion started by: stumpyuk
3 Replies
7. Shell Programming and Scripting
hi all,
Assume that i a having the following three lines in an executable file
#/bin/bash
a=Tue
Tue=1
When i give echo $a the value should be 1, how to do this. Your suggestions please.
Thanks in advance,
Anish (4 Replies)
Discussion started by: anishkumarv
4 Replies
8. Shell Programming and Scripting
hi all,
how do i assign values passed in from command line to and sql statement in perl ?? e.g
i want to assign :name1 and :Name2 to be whatever is passed into the perl script command line
my $sqlStr = "select * from test_table where column1 = upper(nvl(:name1, name1 )) and column2... (1 Reply)
Discussion started by: cesarNZ
1 Replies
9. UNIX for Dummies Questions & Answers
Can anyone tell me what is the purpose of a substitute variable in the unix programming language and give an example where it may be used?
Thanks! (0 Replies)
Discussion started by: mmg2711
0 Replies
10. Shell Programming and Scripting
Hi,
I am trying to redefine the value of a variable based on another variable value. And I want to read in my variables from a enviroment file in the end -- at least I think so. But 1st here's what I want I need to get working:
var_1="11 10 9 8 7 6 5 4 3 2 1"
var_2=3
var_3=4
So I want... (12 Replies)
Discussion started by: John Rihn
12 Replies