10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
I wrote a very simple script to understand how to call user-defined functions from within awk after reading this post.
function my_func_local {
echo "In func $1"
}
export -f my_func_local
echo $1 | awk -F"/" '{for (k=1;k<=NF;k++) {
if ($k == "a" ) {
system("my_local_func $k")
}
else{... (19 Replies)
Discussion started by: sreyan32
19 Replies
3. Shell Programming and Scripting
Hello!
I have a problem to insert variables with sed... And I can't find the solution. :confused:
I would like to display one/few line(s) between 2 values.
This line works well
sed -n '/Dec 12 10:42/,/Dec 12 10:47/p'
Thoses lines with variables doesn't work and I don't find the... (2 Replies)
Discussion started by: Castelior
2 Replies
4. Shell Programming and Scripting
I have searched the forums and other sites and cannot come with the applicable approach for what I am trying to do. I am trying to setup a cron job that executes this script. The script uses iSQL - which is connecting ok - to then query a field and then assign that field to a variable to do an If... (4 Replies)
Discussion started by: courtneyjh
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
can someone please explain to me what i'm doing wrong with this code:
WELT=$(awk '(($1 ~ "^${caag}$") || ($2 ~ "^${caag}$"))' /tmp/Compare.TEXT)
when run from the command line, it works. but it seems to be having a problem doing the comparison when variables are involved.
i tested from... (1 Reply)
Discussion started by: SkySmart
1 Replies
7. Shell Programming and Scripting
Hello,
I have a problem combining two variables into one.
I did the following:
in my env variables i had set
PATH_DESTINATION_1=/root/path_one
PATH_DESTINATION_2=/root/path_two
#!/usr/bin/ksh
count=1
count_path=2
while
do (3 Replies)
Discussion started by: Eraser
3 Replies
8. Shell Programming and Scripting
I am writing a script with a sed call that needs to use a variable and still have quotations be present in the substitution.
Example:
sed -i "s/Replacable.\+$/Replaced="root@$VAR"/g"
this outputs:
where $VAR = place
Replaced=root@place
and i need
Replaced="root@place"
... (2 Replies)
Discussion started by: mcdef
2 Replies
9. UNIX for Advanced & Expert Users
The AppName may be TCS/HCL/SCB.
For All the above 3 i ill have exported TCSDIR/HCLDIR/SCBDIR in .profile with some path.
i'm cnstruct the path in script and trying to cd $VARIABLE, it shows "not found".
Any solution for this....?
> AppName="TCS"
> echo $AppName
TCS
>... (4 Replies)
Discussion started by: palsevlohit_123
4 Replies
10. Shell Programming and Scripting
hi all ,
i wanted to know if someone knows how can i use
a variable inside another variable
e.g.
#!/bin/csh
foreach test(1 2 3)
set sta_$test = "2"
##now its the problem i want to echo the new var
#$sta_$test , each time with anothe num ($test = 1... (2 Replies)
Discussion started by: udi
2 Replies