10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi Guys,
I wrote a collection of bash functions years ago and now need to use them again but
I'm getting some error messages when eval tries to expand the variables names.
I recollect that I used the shopt command to set one of the options but I can't quite
remember the command that I... (8 Replies)
Discussion started by: ASGR
8 Replies
2. Shell Programming and Scripting
My OS is Linux (kernel 4.08.something) and AIX (7100-04-01-1543), the used ksh versions are:
ksh88: Version M-11/16/88f (AIX)
ksh93: Version M 93t+ 2009-05-01 (AIX), Version M 93u (Linux)
When writing a parser for stanza files in ksh i encountered a rather strange behavior. Here is a... (4 Replies)
Discussion started by: bakunin
4 Replies
3. Shell Programming and Scripting
Greetings all,
Disclaimer: I'm a novice and always welcome best practices as I'm learning.
File example:
100,1.1.1.1,1.1.1.2,10.10.10.1,172.16.1.10,172.16.1.20
101,1.1.2.1,1.1.2.2,10.10.20.1,172.16.2.10,172.16.2.20
102,1.1.3.1,1.1.3.2,10.10.30.1,172.16.3.10,172.16.3.20
...and so on
... (3 Replies)
Discussion started by: sjrupp
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
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
6. Shell Programming and Scripting
Hi There,
I am writing a ksh script which assigns variable values from file "A" and passes that variables to file "B". While passing the parameters an additional "$" sign is being assigned to awk -v option.
Could any one help me with this please.
#!/bin/ksh
head -1... (3 Replies)
Discussion started by: Jeevanm
3 Replies
7. UNIX for Dummies Questions & Answers
Hi,
The following code finds the line containing fruits in test.txt and replaces instances of apple with banana.
ed -s test.txt <<< $'/fruits/s/apple/banana/g\nw'
What I want to do is put variables in the place of fruits, apple and banana.
I have tried replacing ' with " to get... (2 Replies)
Discussion started by: de_la_espada
2 Replies
8. Shell Programming and Scripting
hi everybody!
i am running this ksh script for replacing a set of strings by another set of new ones. i am getting both these from a file.
also, the strings that i want to replace, are sub-strings(can occur more than once in each chunk) in a big chunk of data that i have bulk-copied(bcp utility)... (1 Reply)
Discussion started by: trupti wagh
1 Replies
9. UNIX for Advanced & Expert Users
If have
var='$variable'
how can I expand $variable.
I have tried many thing like duble quotes/braces etc, but nothing worked.
I need the solution ASAP. (2 Replies)
Discussion started by: Bsk
2 Replies
10. Shell Programming and Scripting
I'm trying to write a ksh script that uses awk, but I want to pass variables to awk. For example (not working):
if ];then
searchstr=$1
lsof -i | awk '{if($9~/SEARCHSTR/) print $2} SEARCHSTR=$searchstr'
else
echo "usage: $0 <search string>"
fi
I tried several options. Is it... (3 Replies)
Discussion started by: rein
3 Replies