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
I want to assign large number of blanks to a variable in Korn shell. If it is a small number it is fine like if I want to assign 3 blanks I would code
var=" "
But if it is a big number say 100 blanks, what is a better way? Ultimately I will use it in printf statement
printf... (3 Replies)
Discussion started by: Soham
3 Replies
3. Shell Programming and Scripting
I see a millioin ways to do this with echo, but what I wan to do is assign a variable the "nth" character of an incoming parameter to a ksh script.
$1 will be "pia"
I need to assign the first character to stmttype. (10 Replies)
Discussion started by: klarue
10 Replies
4. Shell Programming and Scripting
Hi,
I have a String(words with tab space) in a file ->file1.txt
0xxxx 11 test $aa$ 8.43
when i read the file and assign to variable
value=$(cat file1.txt)
echo $value
i get the output without tab spaces.
0xxxx 11 test $aa$ 8.43
How to assign string... (2 Replies)
Discussion started by: nanthagopal
2 Replies
5. Shell Programming and Scripting
Does anyone know of a way with C Shell that will work on both Linux and Sun to clear all leading and trailing blanks from a previously specified string? I am using the following code to replace blanks with underscores:
set Company = `echo $Company | sed 's/ /_/g
but I don't want any... (1 Reply)
Discussion started by: phudgens
1 Replies
6. Shell Programming and Scripting
Hello Experts,
In my script i am using the below syntax
/usr/bin/head -1 /opt/chumma.txt | /usr/bin/cut -d " " -f3
output of this one is --> Monday
I want to store this String in a variable (i.e) j or k...
Give me some idea experts.
Thanks in advance. (7 Replies)
Discussion started by: natraj005
7 Replies
7. Shell Programming and Scripting
Hi ,I am trying to assign string to variable ,but it doesn't work
Also could you show me different ways to use grep,(I am trying to get the first,second and first column form file,and I am counting the chars)
let name=`grep "$id" product | cut -c6-20` (25 Replies)
Discussion started by: lio123
25 Replies
8. Shell Programming and Scripting
guys,
I need to know how to assing pattern matched string as an input command variable. Here it goes'
My script is something like this.
./routing.sh <Server> <enable|disable>
## This Script takes an input <Server> variable from this line of the script ##
echo $1 | egrep... (1 Reply)
Discussion started by: raghunsi
1 Replies
9. Shell Programming and Scripting
Hi
I need to update a string inside a file which looks like the following:
PX_LIST=" 4119 2390 2294 2776 2897 4099 "
Is there a way to get rid of the blanks after the first quote mark and before the last quote mark.
This needs to be done ONLY for the string named PX_LIST (there are some... (4 Replies)
Discussion started by: aoussenko
4 Replies
10. Shell Programming and Scripting
How...
can I read input by a user character by cahracter. And assign each character from the string to a variable?
Any help would be greatly appreciated!
Thank you! (1 Reply)
Discussion started by: Tek-E
1 Replies