Search Results

Search: Posts Made By: quinestor
4,546
Posted By quinestor
Oh .. that's what I was looking for all along: I...
Oh .. that's what I was looking for all along: I do not need the loop it's just that I'm at level 0 in shell scripting ;) thanks again.

And BTW, the file was created in linux, but with PHP and...
4,546
Posted By quinestor
Hey Scrutinizer, I didn't read your message when...
Hey Scrutinizer, I didn't read your message when I last posted. Thanks for your help

The output of the cat was:


0000000 A U 0 9 2 2 \r \n A U 0 9 0 1 \r \n...
4,546
Posted By quinestor
Ok, removing CR made it work: while read...
Ok, removing CR made it work:


while read AuxLine
do
user_search=`echo $AuxLine | tr -d "\r"`
awk -v idusr=${user_search} 'BEGIN { FS = "," } ; $0 ~ idusr { print $4}' users.txt
done <...
4,546
Posted By quinestor
I am using ubuntu 10.10: #!/bin/bash ...
I am using ubuntu 10.10: #!/bin/bash

Scrutinizer , you are leading me closer to the answer :)
The file userson.txt "looked" exactly like in the code I wrote, but it was generated like this:

...
4,546
Posted By quinestor
Oh yes, users.txt = UserUpdateList. I...
Oh yes, users.txt = UserUpdateList.

I changed the name in the post just to make it less confusing. I'll edit now.


But to add somethig: I just discovered this:


while read AuxLine
do
...
4,546
Posted By quinestor
Which file is different? I was typing myself...
Which file is different?

I was typing myself the names of the files on the post so if there is any mistake with it I am sure the files do exist (they're being read properly)
4,546
Posted By quinestor
Problem passing a search pattern to AWK inside a script loop
Learning, stumbling! My progress in shell scripting is slow. Now I have this doubt:

I have the following file (users.txt):


AU0909,on
AU0309,off
AU0209,on
AU0109,off
And this file...
1,963
Posted By quinestor
Hello, I should have posted a response...
Hello,

I should have posted a response earlier, thanks itkmara for asking me to show the script. I was only thinking on that line and I did not realise the issue was the working path I was using....
1,963
Posted By quinestor
sed not storing output in shell script
Hello,

Following my learning of shell scripting.. I got stuck yet again.
If I execute this command on terminal:


$ sed "s/off/on/g" file > fileAUX


I successfully change the text off to...
4,618
Posted By quinestor
Thank you balajesuri, that works That feels...
Thank you balajesuri, that works

That feels embarrasing..

Now in my defense I can tell that I did look for more info. I found out something that in this case works: to change IFS environment...
4,618
Posted By quinestor
How to use a variable as a command option?
I am just learning shell scripting and already I found out I have the bad habit of thinking that it is similar to php or c.

I learned some basics and now encountered this problem:

On shell it...
Showing results 1 to 11 of 11

 
All times are GMT -4. The time now is 03:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy