Search Results

Search: Posts Made By: AlbertGM
5,278
Posted By AlbertGM
It's not what I expected, but it's a nice and...
It's not what I expected, but it's a nice and simple solution. Did not know why it didn't occur to me... I was stubborn in use an "args" variable, that I didn't realize there was a much simpler...
5,278
Posted By AlbertGM
[Solved] Read and validate input arguments
Hi,
I need to get input arguments, as well as validate them. This is how I'm reading them:

#!/bin/bash
args="$@" # save arguments to variable
## Read input arguments, if so
while [ $# -ge...
1,441
Posted By AlbertGM
It worked!! Thanks a lot. Can you tell me...
It worked!! Thanks a lot.

Can you tell me why 'eval' is necessary and my command did not work without it? I don't understand why.

Anyway, I really appreciate your answer. It saves me a lot of...
1,441
Posted By AlbertGM
Thanks both. I already tried as you both say...
Thanks both.
I already tried as you both say and it doesn't work, either. I also tried using single brackets, and nothing. It looks like it is unable to substitute $LIB_HOME by its content.
Even...
1,441
Posted By AlbertGM
Expansion does not work
Hi,
I'm trying to figure out whether some files exist. Locations of those file are stored in a plain text file called temp.txt in this way:
All environment variables ($LIB_HOME and $ORACLE_HOME)...
21,235
Posted By AlbertGM
Yes, first convert file, then rename it. iconv...
Yes, first convert file, then rename it.
iconv -f ISO-8859-1 -t UTF-8 /loc/test.txt > /loc/test.tmp; mv loc/test.tmp /loc/test.txtYou must be careful, because you'll overwrite original file. First,...
21,235
Posted By AlbertGM
Try iconv command: iconv(1) - Linux man page...
Try iconv command:
iconv(1) - Linux man page (http://linux.die.net/man/1/iconv)

Albert.
1,953
Posted By AlbertGM
Uff, it's too much work. There are more than...
Uff, it's too much work.
There are more than 20 thousand lines in that file, and not all of them has the same pattern.

I just wonder why similar commands had different output. I thought awk and...
1,953
Posted By AlbertGM
Hi, This is the first line that fails (awk...
Hi,

This is the first line that fails (awk only prints 7 characters, although awk output is 8 characters length, 7 zeros and a blank):
Whole line length is 546, but I don't know how post line...
1,953
Posted By AlbertGM
awk substr fails
Hi all,

I want to get each line of a data file from position 464 plus 8 characters. I tried in two different ways, and the results were different. I'd like to know why.

First method, using...
3,770
Posted By AlbertGM
Yes, indeed. Both really help! Thanks. ...
Yes, indeed. Both really help!
Thanks.

By the way, I forgot to tell you I was using cygwin to run those commands and scripts, although it probably doesn't make any difference in all you told...
3,770
Posted By AlbertGM
Hi, vivek d r, I actually didn't make an...
Hi,

vivek d r, I actually didn't make an script. I just ran whole script from command line, preceded by time, ie:
rbatte1, I undestand that you recommend me to learn awk for scripting?
I ran...
3,770
Posted By AlbertGM
Make script faster
Hi all,

In bash scripting, I use to read files:
cat $file | while read line; do
...
doneHowever, it's a very slow way to read file line by line.
E.g. In a file that has 3 columns, and less...
34,971
Posted By AlbertGM
The command is du: For example: if you want to...
The command is du:
For example: if you want to get how much space is used by each subdirectory you can do something like:
find . -maxdepth 1 -type d | xargs du -m -sThis command finds each...
4,192
Posted By AlbertGM
I think something like this should work: ...
I think something like this should work:


ls A/. | while read line; do
filename=`echo $line | cut -d '.' -f1` # gets filename without ext
if [ -f B/$filename.tar.gz ]; then # cheks...
5,023
Posted By AlbertGM
What do you wanna do? Exit causes the shell to...
What do you wanna do?
Exit causes the shell to exit.
Exit an 'if condition' has no sense, unless you are inside a loop. Just change condition, from "equals" to "not equals". For example:

if [...
8,578
Posted By AlbertGM
Hi, In script I posted I checked whether a...
Hi,

In script I posted I checked whether a line is in the other file. To do that I just check its length. If length is 0 it means grep has no output. So, that line is not in file2, and it can be...
8,578
Posted By AlbertGM
I suggest to get a shell reference, if you need...
I suggest to get a shell reference, if you need to program scripts often. In bash: GNU bash manual - GNU Project - Free Software Foundation (FSF) (http://www.gnu.org/software/bash/manual/), available...
2,659
Posted By AlbertGM
Toad can do that for you. Select schema...
Toad can do that for you.
Select schema browser view ==> Right click on table ==> Save as...

Is this enough?
8,578
Posted By AlbertGM
Won't be easy using diff? Anyway, cat...
Won't be easy using diff?
Anyway,
cat file1.txt | while read line; do
if [ -z "`grep "$line" file2.txt`" ]; then
echo $line >> file3.txt
fi
doneAlbert.
3,974
Posted By AlbertGM
I apologize, because it seems to be my mistake. ...
I apologize, because it seems to be my mistake. I'm not able to reproduce such wrong behaviour. So, that means I made a mistake when I typed the command. I think the mistake could be because I could...
3,974
Posted By AlbertGM
You are right. I've just checked it in my own...
You are right. I've just checked it in my own Ubuntu at home and it works.
I don't know which command in CentOS has the problem. It is strange thing, isn't it?


Yes, I already tried it. But it...
3,974
Posted By AlbertGM
ls after find
Hi all,

I'm wondering why this command does not work, at least, as I expect:
find . -type f -mtime +7 -print0 | xargs -0 ls -lI expect that it list all files older than 7 days, with all...
2,954
Posted By AlbertGM
I can't do that because it will replace all...
I can't do that because it will replace all List<..> occurrences, and project won't compile.
Only javadoc comments where generic begins with an "A" must be replaced. It's there where bug makes...
2,954
Posted By AlbertGM
I'll try to ask the question in other way. In my...
I'll try to ask the question in other way. In my Java file I have a line with this text:
* List<AlmacenOrdenacion>). Deberá pasar el id del recinto y el tipo deAnd I want to change to:
* List<...
Showing results 1 to 25 of 51

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