10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have the following script, and I want to assign the output ($10 and $5) from awk to N and L:
grdinfo data.grd | awk '{print $10,$5}'| read N L
output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Discussion started by: geomarine
8 Replies
2. Shell Programming and Scripting
Hello,
I have text data that looks like this,
Mrv16a3102061815532D
6 6 0 0 0 0 999 V2000
-0.4018 1.9634 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.1163 1.5509 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.1163 0.7259 ... (9 Replies)
Discussion started by: LMHmedchem
9 Replies
3. Shell Programming and Scripting
I am reasonably capable with awk and its quirks, but not with shell weirdness. This has to be Bourne Shell for portability reasons. I have an awk program that is working just fine; it handles multiple input streams and produces several reports, based on the request (-v Variables). In addition... (3 Replies)
Discussion started by: DerekAsirvadem
3 Replies
4. Shell Programming and Scripting
I would like to replicate the functionality of chsh (or passwd -e) by awk.
This is what I got so far, but I think there should be an easier way to search and replace field $7 only for lines beginning with user_name:
awk -v user_name="$user_name" -v new_shell="$new_shell" -F: '$1 == user_name {... (2 Replies)
Discussion started by: nomad84
2 Replies
5. UNIX for Dummies Questions & Answers
Hello All,
I have csv file, where one of fields is date (yyyy/mm/dd 00:00:00). Using awk I am trying to find all records with date newer/older than specific date. My idea was to compare unix timestamps of both dates:
start=`date +%s -d "$DateStart"`
awk -v start="$start" -v current=`date +%s... (34 Replies)
Discussion started by: haczyk
34 Replies
6. Shell Programming and Scripting
Hi all,
Hope someone can help me out here.
I have this BASH script (see below)
My problem lies with the variable path.
The output of the command find will give me several fields. The 9th field is the path. I want to captured that and the I want to filter this to a specific level.
The... (6 Replies)
Discussion started by: Cowardly
6 Replies
7. Shell Programming and Scripting
Hi.
How to change string variable in awk?
for example, I parse with awk script text file named some_name_with_extension.txt
I want to print only some_name in my script
....
varCompName = FILENAME
print varCompName
How to put not all symbols from FILENAME to variable?
thank you
This... (4 Replies)
Discussion started by: cintlt
4 Replies
8. Shell Programming and Scripting
I have 3 files and each contain m*n matrix.
m = number of rows (horizontal lines)
n = number of columns (entries in a particular line)
What I wish to find is the sum of the 2nd number in the last row.
Ex
file1.dat
2 5 8 8
4 6 7 8
3 8 3 7
file2.dat
3 4 1 4
8 4 0 3
4 7 3 7
... (3 Replies)
Discussion started by: dynamics
3 Replies
9. Shell Programming and Scripting
Dear All,
we have a command output which looks like :
Total 200 queues in 30000 Kbytes
and we're going to get "200" and "30000" for further process. currently, i'm using :
numA=echo $OUTPUT | awk '{print $2}'
numB=echo $OUTPUT | awk '{print $5}'
my question is : can I use just one... (4 Replies)
Discussion started by: tiger2000
4 Replies
10. Shell Programming and Scripting
Hi All,
I am trying the following to set the environment variable in my scirpt.But it is not setting with the correct value.
Can you guys please help me out to get the correct value.
1. I have environment variable NLS_LANG=American_America.UTF8
2. In my script (ksh) i am trying the following... (1 Reply)
Discussion started by: girish.raos
1 Replies