10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello, new to the forums and to awk. Glad to be here. :o
I want to pass two shell (#!/bin/sh) variables through to awk and use them. They will determine where to start and stop text extraction.
The code with the variables hard-coded in awk works fine; the same code, but with the shell... (7 Replies)
Discussion started by: bedtime
7 Replies
2. Shell Programming and Scripting
Trying to do so
echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies
3. Shell Programming and Scripting
hi,
i have a shell script which calls another shell which in turn calls another shell script.
Main_shell_script.sh
echo "In Main_shell_script.sh"
FILENAME="original.txt" # LINE 1
DST_FILENAME=$FILENAME # LINE 2
echo "FILENAME = {$FILENAME}"
echo "DST_FILENAME =... (3 Replies)
Discussion started by: Little
3 Replies
4. Shell Programming and Scripting
Using ksh to call a function which has awk script embedded.
It parses a long two element list file, filled with text numbers (I want column 2, beginning no sooner than line 45, that's the only known thing) . It's unknown where to start or end the data collection, dynamic variables will be used. ... (1 Reply)
Discussion started by: highnthemnts
1 Replies
5. Shell Programming and Scripting
Hi.
I need to parse file and assign some values to variables, right now i do like below
MYHOMEDIR=`awk '/Home/ {print $NF}' output.txt`
MYSHELL=`awk '/Shell/ {print $NF}' output.txt`
PRGRP=`awk '/Primary/ {print $NF}' output.txt`
SECGRP=`awk '/Second/ {print $NF}' output.txt`
In this... (10 Replies)
Discussion started by: urello
10 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I have two files File1 & File2.
File1
76 135
136 200
250 345
....
File2
1 24
1 35
1 36
1 72
....
I want to get all the values form File2 corresponding to the range in File 1 and feed it to a program. Is the code below right? Can I pass shell variables to awk in this... (2 Replies)
Discussion started by: Gussifinknottle
2 Replies
7. Solaris
Hi Guys,
My requirement is I have file called /opt/orahome/.profile in non global zone.
PATH=/usr/bin:/usr/ucb:/etc:/usr/sbin:/usr/local/bin:/usr/openwin/bin:.
export PATH
PS1="\${ORACLE_SID}:`hostname`:\$PWD$ "
export PS1
EDITOR=vi
export EDITOR
ENV=/opt/orahome/.kshrc
export ENV... (1 Reply)
Discussion started by: vijaysachin
1 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I do have some variables accessed in more than one script. I want to have those variables in a command file anduse them. Something like a header file that we use in C programs. I dont want to set them as environment variables. Is there any other option, like header file in scripting ??
... (2 Replies)
Discussion started by: risshanth
2 Replies
9. Shell Programming and Scripting
I am trying to pass the results from a variable gathered from awk, however when I echo the 'PARSE' and 'SUB', the response is blank. This is my command.
awk -F= '/Unit/''{ PARSE=substr($2,1,5) ; SUB=substr($2,1,1) }' inputfile.lst
Is this a kind of valid attempt or am I obligated to declare... (3 Replies)
Discussion started by: gozer13
3 Replies
10. Shell Programming and Scripting
Hello,
Can we pass shell variables like $PATH etc. to a awk program part
for example,
awk ' {
fieldValue=$PATH
....
}' file (1 Reply)
Discussion started by: Vishnu
1 Replies