10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
For example: I am grepping "Hello" from a file and there are 10 matches. So all ten lines with match will get stored into a variable($match). Now I want to ignore those lines which have "Hi" present in that.
Currently I tried this: match = grep "Hello" file | grep -v "Hi" file
But that's not... (2 Replies)
Discussion started by: pavan
2 Replies
2. Shell Programming and Scripting
Hello!
#!/usr/bin/env python
hn = "simsa-svr"
for container in containerslist:
Name = container
I want to print Name along with hn i,e simsa-svr. I tried like Name = container'-'.join(hn) did not work.
Needed result: lilly2232321-simsa-svr (2 Replies)
Discussion started by: ashokvpp
2 Replies
3. Shell Programming and Scripting
Hi ,
I am executing 2 queries and output is saved in file1.txt and file2.txt
example of file1.txt
Testing word Doc.docx,/Lab/Development and Validation/Multitest/MT_010708/Testing,Development and Validation,root,11-Mar-2014,,,,,
Testing Excel _.xlsx,/Lab/Development and... (3 Replies)
Discussion started by: Sunil Mathapati
3 Replies
4. UNIX for Dummies Questions & Answers
As the title says I'm running a korn script in attempts to find an exact match in named.conf
finddomain.ksh
#!/bin/ksh
#
echo "********** named.conf ************"
file=/var/named/named.conf
for domain in `cat $1`
do
grep -n '"\$domain "' $file
done
echo "********** thezah.inc... (1 Reply)
Discussion started by: djzah
1 Replies
5. Shell Programming and Scripting
Hi,
I've been stuck for several days on this. Using grep on a command line, I can use quotes, eg...
grep 'pattern of several words' filename
I want to do this in my bash script. In my script I have captured the several command line arguments (eg arg1 arg2) into a variable:
variable=$@
I... (2 Replies)
Discussion started by: adrian777uk
2 Replies
6. Shell Programming and Scripting
Hi All
this may be somewhere in internet , but couldnt find the it.
i have file as
abc01
2010-07-01 12:45:24
2010-07-01 12:54:35
abc02
2010-07-01 12:59:24
2010-07-01 01:05:13
abc03
.
.
.
the output using awk should look like this
abc01|2010-07-01 12:45:24|2010-07-01 12:54:35... (3 Replies)
Discussion started by: posner
3 Replies
7. UNIX for Dummies Questions & Answers
Hello,
I'm running calculations and I need to extract a specific number from a output file. So far I've only been able to GREP entire lines containing the string: '1 F=' . I would like to go a step further and extract just the number following '1 F='. The entire line looks like:
1 F=... (10 Replies)
Discussion started by: modey3
10 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
I hope you can help. i am concatenating String variables using the following method.
command="$command$x"
i have created a script which takes a set of args passed to the script using the $*
#example script
args=$*
count=0
for x in $args
do
count=`expr $count + 1`
... (8 Replies)
Discussion started by: duke
8 Replies
9. Programming
This is a simple question...
char *str = NULL;
int num = 0;
scanf ("%d", &num);
str = ???
I want str to point to the string num.txt
For e.g: If user enters num = 5,
str should point to "5.txt"
How do I do that ?
Thanks (2 Replies)
Discussion started by: the_learner
2 Replies
10. Shell Programming and Scripting
hey,
I want to concat whole bunch of strings together but somehow they don't turn out the way I want them to
a="HELLO "
b="WORLD "
c=$a$b
I was expecting c to be "HELLO WORLD " but it... (1 Reply)
Discussion started by: mpang_
1 Replies