10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
We have a requirement of picking nth position value by using cut command. value would be delimited by any symbols. We have to pass delimited value and postition to get the value in a string.
ex.
echo "A,B,C,D,E" |cut -d "," -f3
echo "A|B|C|D|E"|cut -d "|" -f2
Kindly frame the... (5 Replies)
Discussion started by: KK230689
5 Replies
2. Shell Programming and Scripting
I have file called in in.txt contains with the below lines I want to display the lines between the value which I would be passing.
one
two
three
four
five
ten
six
seven
eight
Expected output if I have passed one and ten
two
three
four
five (8 Replies)
Discussion started by: mychbears
8 Replies
3. Shell Programming and Scripting
Hi All,
I am new to AWK programming. I have the following for loop in my awk program.
cat printhtml.awk:
BEGIN
-------- <some code here>
END{
----------<some code here>
for(N=0; N<H; N++)
{
for(M=5; M<D; M++) print "\t" D "";
}
-----
}
... (2 Replies)
Discussion started by: ctrld
2 Replies
4. Shell Programming and Scripting
sqlplus -s $USER_ID@$SID/$PWD<<EOF>sql_1.txt
set feedback off
set heading off
select 114032 as c_1 from dual ;
EOF
for i in `cat sql_1.txt`
do
sh script_1.sh $i
Currently i am passing one column value to the single unix variable.
How can i pass the values from 2... (2 Replies)
Discussion started by: rafa_fed2
2 Replies
5. Shell Programming and Scripting
I am writing a script where I need awk to test if two columns are the same and shell to do something if they are or are not.
Here is the code I'm working with:
@ test = 0
...
test = `awk '{if($1!=$2) print 1; else print 0}' time_test.tmp`
#time_test.tmp holds two values separated by a space... (3 Replies)
Discussion started by: Malavin
3 Replies
6. Shell Programming and Scripting
consider the script below
sh /opt/hqe/hqapi1-client-5.0.0/bin/hqapi.sh alert list --host=localhost --port=7443 --user=hqadmin --password=hqadmin --secure=true >/tmp/alerts.xml
awk -F'' '{for(i=1;i<=NF;i++){
if($i=="Alert id") {
if(id!="")
if(dt!=""){
cmd="sh someScript.sh... (2 Replies)
Discussion started by: vivek d r
2 Replies
7. UNIX for Dummies Questions & Answers
Hi,
My script will take 3 i/p's from user. Now i need to pass these 3 values to remote server. Please find my code.
while
do
echo " To which server you want to connect ? "
echo " 1. server1 \n"
echo " 2. server2 \n"
read opt_server
if
then
echo "enter the... (2 Replies)
Discussion started by: sree143reddy
2 Replies
8. Shell Programming and Scripting
Would really appreciate it if someone could point out my mistake in this line of code, i've been staring blankly at it trying everything i can think of some time now and coming up with nothing.
#!/bin/bash
echo "Enter Username"
read Username
awk -F: -v var=${Username} '/^var:/... (9 Replies)
Discussion started by: Nostyx
9 Replies
9. UNIX for Dummies Questions & Answers
one of my colleagues has this question.
he has a command, C_CMD which accepts 4 variables, $1 $2 $3 $4
he wants to load up a file with multiple rows, one row per set of variables and then iteratively execute the command based on the content of the file.
example:
at the command line you'd... (5 Replies)
Discussion started by: LisaS
5 Replies
10. Shell Programming and Scripting
found that passing (input) values to awk, all work well. For example:
errpt | awk 'BEGIN { errore=0 }
substr($2,1,4) /'ParamData'/ {
....
} ' ParamData=`date +"%m%d"`
Now I wish to obtain (output) a value. Using this method is it possible to re-write ParamData, for example?
Thanks in... (3 Replies)
Discussion started by: gio123bg
3 Replies