10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello Guys,
I would like to ask you for a favor. Could you please help me how can I assign any number as the parameter to a, from stdin (-c), in the following command line by using the 'switch' in a script?
awk '$8>a {print "File name:" $5,$8}'
I would also appreciate if you can share any... (1 Reply)
Discussion started by: Padavan
1 Replies
2. Shell Programming and Scripting
Hello,
First of all, I'd like to say hello to all members of forum.
Can You please help me with the matter described below?
I am trying to fetch a data from the file to variable, I am doing this using below script:
returned=`tail -50 SapLogs.log | grep -i -E "Error|"`
echo $returned
... (2 Replies)
Discussion started by: jedzio
2 Replies
3. Shell Programming and Scripting
I am trying to count the number of records from different files using grep, and then place the result in a separate variable for each file, so at the end of my shell script, I can sum all the variables and check if the number of records are equal to what I was expecting. It is weird butwc -ldoes... (2 Replies)
Discussion started by: dhruuv369
2 Replies
4. Shell Programming and Scripting
Hello All,
I am facing difficulty in getting the PID value & then assigning it to a variable,
kindly help me in resolving the issue.
Thanks a lot in advance.
The custom utility used inside the Test2.sh will process the file in a batch of 10 lines at once and for efficient memory management,... (3 Replies)
Discussion started by: duddukuri
3 Replies
5. Shell Programming and Scripting
I am writing a script that requires the number of days in any given month.
In the shell, I can use the command:
cal `date +%m` `date +%Y`| grep -v '' | wc -w
to give me the number of days in the month, but when I assign it to a variable:
VAR=`cal `date +%m` `date +%Y`| grep -v '' | wc... (3 Replies)
Discussion started by: skaptakalian
3 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I have a question regarding the awk command. Here is the line I need to grep:
1 F= -.13250138E+03 E0= -.13249556E+03 d E =-.174650E-01 mag= 35.2157
Instead of displaying the number in red I would like to store it as a variable such as X. Is there a way to do this? Thanks for any... (3 Replies)
Discussion started by: modey3
3 Replies
7. UNIX for Dummies Questions & Answers
I want to display "no results found" if a grep search of a name that the user inputs is not found anywhere in a certain file,
Right now I have this, but doesn't seem to work. Im not sure what to change.
read name
results=grep -c $name file
if ;
then echo "No results found."
exit... (1 Reply)
Discussion started by: busdude
1 Replies
8. Shell Programming and Scripting
Hi All,
I am getting the output for the following command when i run it on the unix console.
---------------------------
grep `whoami` /etc/passwd | awk '{print ($1);}' | cut -d ":" -f3
----------------------------
But i made it into a script and tried to print the variable, its... (5 Replies)
Discussion started by: meheretoknow
5 Replies
9. UNIX for Dummies Questions & Answers
File1.txt
.......
.......
OMC LA
OMC LK
OMC LS
........
........
Above is the content of File1.txt, i want to get the Number of Occurence to order, lets say if OMC LA = 1, OMC LS=3, and OMC LK=2..
omc_ident="OMC LA" or "OMC LK" or "OMC LS"
omc_num=`grep '^OMC' File1.txt| grep... (4 Replies)
Discussion started by: neruppu
4 Replies
10. Shell Programming and Scripting
Hi,
My objective is to get the line number of the first occurance of the search pattern.
my test.txt contains:
..... ..................
total rows....
................... ..
total rejected rows: 40
total rejected rows: 50
total rejected rows: 80
total rejected rows: 90
total... (9 Replies)
Discussion started by: mercuryshipzz
9 Replies