10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm reading a text file using a while loop but when I call a function from within this loop it exits that same iteration … even though there are many more lines in the file to be read.
I thought it was something to do with the IFS setting but it appears that a function call (when run... (3 Replies)
Discussion started by: user052009
3 Replies
2. Shell Programming and Scripting
Am looking to pass some Linux environment variables into AWK , can I simply use the -v option ?
awk -F: -v AHOME=$HOME '{ if
{rm AHOME/file.txt
a=2 } }'
config.txt
... (4 Replies)
Discussion started by: alldbest
4 Replies
3. 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
4. Shell Programming and Scripting
I'm trying to use awk to write new entries to a hosts file if they don't exist. I need to do so depending on the type of system I have. Below is what I have, but it isn't working.
awk -v myip1=$IP1 myip2=$IP2 myhost1=$HOST1 myhost2=$HOST2' BEGIN { mqhost1=0; mqhost2=0; stap1=0; stap2=0; }
... (4 Replies)
Discussion started by: Boomn4x4
4 Replies
5. 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
6. Shell Programming and Scripting
Hi Guys,
I have an issue with awk and variables. I have trawled the internet and forums but can't seem to get the exactt syntax I need.
I have tried using awk -v and all sorts of variations but I have hit a brick wall. I have spent a full day on this and am just going round in circles.
... (3 Replies)
Discussion started by: gazza-o
3 Replies
7. Shell Programming and Scripting
Hi, i need help passing variables to sed using ksh.
My goal is to get particular data from log files.
first i put a mark to the log files.
echo "TEST_"`date + %m_%d_%Y_%T"` >markFile
this will produce a 'markFile' which contain text like this
TEST_06_01_2009_21:55:09
then i put the mark... (2 Replies)
Discussion started by: d.anggrianto
2 Replies
8. Shell Programming and Scripting
How do i get the value of the variable from the called script(script2) to the calling script(script1) in ksh ?
I've given portion of the script here to explain the problem.
Portion of Script 1
=============
-----
-----
tmp=`a.ksh p1 p2 p3`
if then
# error processing
fi
-----... (10 Replies)
Discussion started by: rajarkumar
10 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
Hi
I have a unix shell script with an awk statement. I would like to print some of the fields of an input file. However, I would like to print them dynamically, ie by passing the literal $1 $3 into the script to define the output.
I have tried the following:
variable1='$1'
awk... (2 Replies)
Discussion started by: Bab00shka
2 Replies