when i write
echo $RESULTS
it gives me the results in multple lines.
That is very odd. By doing echo $RESULTS without double quotes around $RESULTS, it should have flattened all whitespace for you. echo "$RESULTS" would show it on several lines but echo $RESULTS should not. Have you changed the value of IFS anywhere in your script?
That is very odd. By doing echo $RESULTS without double quotes around $RESULTS, it should have flattened all whitespace for you.
Not necessarily. This is true for bash, but the OP did not mention which shell s/he is using. I just tried it with zsh, and this one does not flatten, but preserves the newlines.
im learning grep and i need some help.
i have input word file like this
fish map.this is
go to.that is
i want sed,awk or grep command to
extract the following in this format
someword SPACE someword.so output will be
fish map.
go to.Please use CODE tags as required by forum... (11 Replies)
Hi:
This is my first post in this forum. apologies if I am asking question that has been asked here multiple times.
I wrote a python script that prints list of identifiers. I have another file notoriously big and with no particular format.
I plan to search the identifiers in this file... (2 Replies)
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Hi,
I have two variables x and y.
i need to find a particular string in a file, a workflow name and then insert the values of x and y into the next lines of the workflow name.
basically it is like as below
wf_xxxxxx
$$a=
$$b=
$$c= figo
$$d=bentley
i need to grep the 'wf_xxxx' and then... (6 Replies)
Hello Everyone,
I just started scripting this week. I have no background in programming or scripting.
I'm working on a script to grep for a variable in a log file
Heres what the log file looks like. The x's are all random clutter
xxxxxxxxxxxxxxxxxxxxx START: xxxxxxxxxxxx... (7 Replies)
Hi
I really hope someone can help with the below question.
Lets say that I have a file called output.txt and I want to display all of the lines which contain the word ‘disconnect'. I know that this can easily be obtained by using the following command:
grep -i disconnect output.txt
However,... (6 Replies)
I know how to grep, copy and paste a string from a line. Now, what i want to do is to find a string and print a string from the line below it. To demonstrate:
Name 1: ABC Age: 3
Sex: Male
Name 2: DEF Age: 4
Sex: Male
Output:
3 Male
I know how to get "3". My biggest problem is to... (4 Replies)
Hello,
Perhaps someone here can help with this. I'd like to grep a plain text file for a word and output each line containing a word found to a seperate line instead of back to back.
Examples:
Basic command:
cat file.txt > grep -i CAT > results.txt
file.txt:
The cat said meow
The... (7 Replies)
When I type a command at the command line it supplies one result and the exact same command in a script
egrep '^01|^02|^03|^04' file > fileout
count = 29353
same count in the script yields a count of 23492
is there any reason this could be happening. (1 Reply)