08-18-2008
get value back from awk script
I want to receive a value back into shell script from awk code block.
for example - I want to use the substring value from the awk script inside the shell code's scope.
do
dir=`dirname $file`;
echo | awk '{print substr("'"${dir}"'",'$pathlength')}';
done
can someone guide me how to do that?
any pointers appreciated.
thanks,
Iyer
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am passing a varaible to from Shell to awk then I am doing some maniplation for that variable inside awk. I want that maniplated variable value back to shell , Is this possible .Please let me know. (12 Replies)
Discussion started by: unishiva
12 Replies
2. AIX
Hi ,
Can you suggest me how to back to back printing in UNIX? Is there any way?
Kindly advise.
Regards
Vijaya Amirtha Raj (3 Replies)
Discussion started by: amirthraj_12
3 Replies
3. Shell Programming and Scripting
Helo,
I want to write shell script which takes back of all binaries (exe files).
and when i uninstall the upgraded system which automatically restore the old binary which we have take as back up.
can u tell me how to write such shell scripts.
Regards,
Amit (5 Replies)
Discussion started by: amitpansuria
5 Replies
4. IP Networking
Hi every body,
Is it possible to connect two servers Back-to-Back (Point-to-Point) using HBA adapters & using Fiber.
Note it is direct connection & there is no switches between the servers.
I'm concern about using HBA adapters, it is possible or not.
Thanks in advance. :) (3 Replies)
Discussion started by: aldowsary
3 Replies
5. Shell Programming and Scripting
I have a script "a" running in background. From script "a" i will kick off script "b" which will also be in background. Is this possible. And actually what i want is, In script "b" when i do ps -ef, script "a" should not be seen.
Current "a" script
----
---
----
nohup b
exit
current... (1 Reply)
Discussion started by: vasuarjula
1 Replies
6. Shell Programming and Scripting
I'm trying to write a script to back up with rsync, the script I am posting below:
nomServer="shiva horus isis"
dirshiva="/etc /faturamento"
shivaListExc="/usr/local/bin/shivaListExclRsync"
dumpDir="$dumpFile/Shiva"
dateBkp=`date +%A`
for nServer in ${nomServer}
do
... (3 Replies)
Discussion started by: ajmoreti
3 Replies
7. Shell Programming and Scripting
Hello!
I need to come back one line in awk when i detect a regular expression, i'm working with this:
/<POLITIC>/,/<\/POLITIC>/
when i found the line that matches with <\/POLITIC> i need to come back one line, the opposite of getline that takes a new line and continue executing the... (4 Replies)
Discussion started by: claw82
4 Replies
8. Shell Programming and Scripting
Hello all,
I am trying to do a tail in a script. But when I quit the tail my script quits also. This is not what I want. I am struggling to get this done.
#!/bin/bash
askFile() {
echo -n "Enter file: "
read FILE
}
doTail() {
tail -F "${1}"
}
askFile
doTail... (4 Replies)
Discussion started by: markdark
4 Replies
9. Shell Programming and Scripting
Can somebody help me with this? I'm sure it's a no-brainer if you know awk... but I don't.
Input:
Blah
Blah
Me love you
long time
Blah
Blah
awk magic with 'long time'
==>
Output:
Blah
Blah
Me love you long time (0 Replies)
Discussion started by: Ryan.
0 Replies
10. Shell Programming and Scripting
Hi friends,
i have two scripts(call it bg1.ksh and bg2.ksh) which needs to be run parallely on background from a script(call it test1.ksh).then i have to wait till these two back ground job gets finished. and once it is completed , then i have to trigger one more script(call it... (4 Replies)
Discussion started by: neelmani
4 Replies
IGAWK(1) Utility Commands IGAWK(1)
NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO
gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
Free Software Foundation Nov 3 1999 IGAWK(1)