10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Dear UNIX forum members,
I am using macbook pro 13 (2015 edition) with MAC OS Mojave and am trying to write the shell script where when it is run through terminal it asks for an input (in the code below an input variable is domains) and then that input becomes capital letter or letters which... (3 Replies)
Discussion started by: Aurimas
3 Replies
2. UNIX for Advanced & Expert Users
I have a below syntax its working fine...
var12=$(ps -ef | grep apache | awk '{print $2,$4}')
Im getting expected output as below:
printf "%b\n" "${VAR12}"
dell 123
dell 456
dell 457
Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
3. UNIX for Dummies Questions & Answers
Hello All,
May i please why my shell variable is not getting passed into awk script.
#!/bin/bash -vx
i="1EB07C50"
/bin/awk -v ID="$i" '/ID/ {match($0,/ID/);print substr($0,RSTART,RLENGTH)}' /var/log/ScriptLogs/keys.13556.txt
Thank you. (1 Reply)
Discussion started by: Ariean
1 Replies
4. Shell Programming and Scripting
Hi,
I would like to compare 2 files using awk, which I can do by using:
awk 'NR==FNR{a;next} (NR > 32 && $2 in a) {print $0}' File1 and File2.
If the name of the File1 is in another file (for example, column 4 in File 3) then how can I pass this column 4 to the awk command.
Thanks in... (1 Reply)
Discussion started by: ezhil01
1 Replies
5. Shell Programming and Scripting
Hi
i have a shell script which needs a string as an input parameter. How to pass the string param as an input?
In command line am running the script.
for e.g.,
a="who is a buddy?"
sh sample.sh $a
Inside the script i get this input param as $1 but only the value "who" is accepted... (12 Replies)
Discussion started by: vidhyaS
12 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I have a file with 4 columns.
An arbitrary example is shown below:
a Tp 10 xyz
b Tq 8 abc
c Tp 99 pqr
d Tp 44 rst
e Tr 98 efg
Based on the values in col 2 and col 3, I will execute another program.
I have been running this:... (5 Replies)
Discussion started by: Gussifinknottle
5 Replies
7. Shell Programming and Scripting
Hi, I had to create a new thread as the old thread had to much of confusion
I have two files shashi.sh and py.py
I want to pass a variable from shashi.sh to py.py. How do i achieve that ?.
shashi.sh
export X=12
echo "$("pwd")"
echo "$X"
exec python py.py "$(X)"
py.py... (0 Replies)
Discussion started by: shashi792
0 Replies
8. UNIX for Dummies Questions & Answers
I am trying to search a log for a particluar pattern listing the total # of occurences in the end.
I thought using a shell script for input then calling awk to search for the paramters specified. I want the script to be usable acorss envs.
Code:
#! /usr/bin/bash
# get the variables... (5 Replies)
Discussion started by: wawa44oz
5 Replies
9. Shell Programming and Scripting
I am trying to make a simple script in which i take input from shell and then forward the value to
nawk (BEGIN).
but when i run below mention script so it give no output.
echo "Enter TRUNK GROUP:"
read TGR
cat /omp-data/logs/5etr/080422.APX | nawk -F"|" -v P=$TGR '
BEGIN {
TG=P;... (1 Reply)
Discussion started by: wakhan
1 Replies
10. Shell Programming and Scripting
dear all
How to passing the parameters or results to outside of the AWK program? anyone can help
awk '{print $1}' file1 > $a ? (2 Replies)
Discussion started by: trynew
2 Replies