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
How does one assign a variable, x to equal the number of records in a different file.
I have a simple command such as below:
awk -F "\t" '(NR>5) { if(($x == "0/0")) { print $0} }' a.txt > a1.txt
but I want x to equal the number of records in a different file, b.txt (10 Replies)
Discussion started by: Geneanalyst
10 Replies
3. UNIX for Beginners Questions & Answers
Hello All,
Hope you're doing well !
I am trying below command to be passed in a shell script, header_date_14 is a variable and $1 is the name of a file I intend to pass as a command line argument, however command line argument is not being accepted.
header_date_14=$(m_dump... (8 Replies)
Discussion started by: ektubbe
8 Replies
4. Shell Programming and Scripting
Hello Gurus,
Here is my requirement. I need to find the number of lines in a file and need to assign it to a variable. This is what I did and not wroking.
#!/bin/ksh
set -xv
Src_Path=/mac/dev/Generic/SrcFiles
Src_Count=wc -l ${Src_Path}/FILE_JUNE.txt
Count_file = $Src_Count | awk -F... (2 Replies)
Discussion started by: thummi9090
2 Replies
5. Shell Programming and Scripting
I have the below script running for generating file from PL/SQL stored procedure. I need to declare a shell variable and then pass this to sqlplus command to pass the same as a INPUT parameter for the stored procedure. Please help to do this.
#!/bin/sh
minlimit=0
maxlimit=10
size=100
while... (0 Replies)
Discussion started by: vel4ever
0 Replies
6. Shell Programming and Scripting
Hi to all in forum,
I'm trying to convert the letter number between 1 (A) and 26 (Z), that part is working, my issue is how to assign the printf output to a variable:LetterNumber=10
printf "\x$(printf %x $((${LetterNumber}+64)))"
$ J
#The problem, how to assign printf output (J in this... (8 Replies)
Discussion started by: Ophiuchus
8 Replies
7. 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
8. Shell Programming and Scripting
I have a file with a list of config files numbered on the lefthand side 1-300. I need to have bash read each lines number and assign it to a variable so it can be chosen by the user called by the script later.
Ex. 1 some data
2 something else
3 more stuff
which number do you... (1 Reply)
Discussion started by: glev2005
1 Replies
9. Shell Programming and Scripting
Hi,
I need a regular expression grepping all lines starting with '*' followed by a VARIOUS number of blanks and then followed by the string 'Runjob=1'.
I tried that code, but it doesn't work:
grep -i '*'+'Runjob=1' INPUT_FILE >>OUTPUT_FILE
Can someone help me?
Thanks (8 Replies)
Discussion started by: ABE2202
8 Replies
10. Shell Programming and Scripting
Hi All,
I am new to bash scripting. I need your help to removing spaces from a string and assign them to different variables.
Iwant to call script with one command line argument which is file name which containes different attributes their type and different values eg
... (1 Reply)
Discussion started by: flextronics
1 Replies