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
DELETE=`cat $logfile1 | egrep -i "Delete" | sed 's/ */ /g' | cut -d" " -f2`
INSERT=`cat $logfile1 | egrep -i "Insert" | sed 's/ */ /g' | cut -d" " -f2`
UPDATE=`cat $logfile1 | egrep -i "Update" | sed 's/ */ /g' | cut -d" " -f2`
I need soming like below:
if value is null... (8 Replies)
Discussion started by: Veera_V
8 Replies
3. Shell Programming and Scripting
Hi guys,
I'm currently writing a script for automating a FreeBSD ZFS setup (ZFSonRooT). I got stuck at one point for raidz(1,2 a.k.a raid5,6) and am in need of assistance.
This is what I need. example:
#!/bin/sh <- must stay sh
echo -n "hdd list: "
read hdd_list
echo -n "hdd label list:... (2 Replies)
Discussion started by: da1
2 Replies
4. 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
5. Shell Programming and Scripting
Here is the sample of my file address.txt
Address 1
1234 Drive way
New Orleans, LA
Zipcode :- 12345
Address 2
4567 Spring way
Chicago, IL
Zipcode :- 67890
I would like to grep for an Address title (Ex :- Address 2) , then get its zipcode and echo both in a single line. Ex :- ... (3 Replies)
Discussion started by: leo.maveriick
3 Replies
6. Shell Programming and Scripting
Hi, I've been running code which very frequently calls books.csv. e.g:
grep -i horror books.csv > tempExcept, I'm trying to move away from using temporary files or frequently calling books.csv to improve efficiency. So I tried something like
bookfile=$(cat books.csv)
grep -i horror... (4 Replies)
Discussion started by: Quan
4 Replies
7. Shell Programming and Scripting
Hi ,
Help required
i want to grep a pattern from a file using "grep -n" command
then cut the field (i.e line number return by cut command) and
assign it to a variable
e.g
var=grep -n "end" FILE1 | cut -f1 -d":"
But i am not able to perform this operation.
i am performing all... (6 Replies)
Discussion started by: xyz123
6 Replies
8. UNIX for Dummies Questions & Answers
I'm trying to find files which have urls such as "services/amf/fri/home.html" and "services/amj/fri/air.html" - so the pattern I want to match with grep, logically, is one that has
1. "services/"
2. stuff in between including slashes, numbers, underscores etc
3. ending in "html"
Can... (5 Replies)
Discussion started by: pauljohn
5 Replies
9. Shell Programming and Scripting
Hi,
I'm quite new to scripting and I want to modify following line of an existing script:
MYVAR=`subst |grep 'L:\\\:' | sed -e 's/.*\\\//'`;
What I have to do is to use the content of a variable instead of the constant expression 'L:\\\:' as the grep string to be matched.
Assuming I already... (5 Replies)
Discussion started by: snowbiker99
5 Replies
10. Shell Programming and Scripting
i am still confusing on how to use sed, grep and awk if the input is not a file but a variable.
such as:
a="hello world"
b="how are you"
c="best wish to you"
d="222,333,444"
what if i want to check which variable $a,$b,$c,$d have contain "you"
what if i want to replace the word "you"... (9 Replies)
Discussion started by: 3Gmobile
9 Replies