I have a problem with my shell script. As a quick overview I need to change a template file 6561 times and copy the file into a new catalogue. Thanks to your forum I have managed to write a script to do so:
Finishing this script takes a lot of time and it went well after I checked it after an hour, but at some point it starts to give errors:
I tried to name a folder with the maximum characters my script had and it worked. So I can't see the problem.
Yes - but it is the length of the FULL pathname including your directoryname, e.g.,
/path/to/my/list/of/files/./A285-B285-C285-D285-E285-F285-G285-H285
that the system is complaining about.
will tell you the limit of the number of characters in a fully qualified pathname. Start with that to check your filename problems.
This User Gave Thanks to jim mcnamara For This Post:
Yes - but it is the length of the FULL pathname including your directoryname, e.g.,
/path/to/my/list/of/files/./A285-B285-C285-D285-E285-F285-G285-H285
that the system is complaining about.
will tell you the limit of the number of characters in a fully qualified pathname. Start with that to check your filename problems.
Thank you very much. I tried it, but it didn't find "PATH_MAX" in the file. So I just tried "MAX". I hoped there is an equivalent keyword there, but I didn't find anything I could relate to pathname. I copy the results here, maybe you might notice it:
Thank you in advance,
Mario
Edit: Maybe I should shorten the script by deleting the letters and only leave the degrees (numbers) in the folder names, since I analyze the results later with another sript and due to that I don't need the letters so badly?
Last edited by mario8eren; 09-01-2010 at 04:39 PM..
Reason: An idea.
We need to know exactly what Operating System you have and the exact version (with all decimal places).
(Blot anything confidential).
Between this post and your previous post about the same script it would appear that the "bash" Shell is keeling over with insufficient environment space and generating spurious or blank command parameters.
Btw. Googling the "mkdir" error message only comes up with Gentoo Linux.
There is excessive repetiton of parameter substitution.
Just saving the common factor for an iteration ready for the next time it is required will save over 400,000 shell parameter substitutions.
e.g.
We need to know exactly what Operating System you have and the exact version (with all decimal places).
(Blot anything confidential).
I am not sure if this is helpful:
But I know, that I am using Debian.
Quote:
Between this post and your previous post about the same script it would appear that the "bash" Shell is keeling over with insufficient environment space and generating spurious or blank command parameters.
Btw. Googling the "mkdir" error message only comes up with Gentoo Linux.
There is excessive repetiton of parameter substitution.
Just saving the common factor for an iteration ready for the next time it is required will save over 400,000 shell parameter substitutions.
e.g.
I am not sure if I understood you correct. Are you saying that the script is not working because it has to change too many parameters in one turn and all together it has too many parameters?
And also if you have the time could you provide a link on how to use the command instance exactly, because Googling for it gives me wrong shells and wrong instances .
Thanks in advance,
Mario
Edit: I just cut the script into little pieces and it seems everything works until the shell has to use "source" command.
These kind of small scripts worked fine.
Even this worked ok:
When it had to deal with the Turbomole program (tm510) then it worked good at first, but at some point it started to give the "argument list too long" error:
So I am really confused, because it seems to work at first, but fails at some point. And I removed most of the variables. And I can't understand why the mkdir or babel command worked well and x2t wont work.
Last edited by mario8eren; 09-02-2010 at 05:41 AM..
Reason: Noticed something else while trying new things.
To bakunin and corona688:
My result when text in file is
ms_ww_546
ms_rrL_99999
ms_nnn_67_756675
is
https://www.unix.com/C:\Users\Fejoz\Desktop\ttt.jpg
I hope you can see the picture. There is like a "whitespace character" after 2 of the 3 created directories.
---------- Post... (0 Replies)
Hi,
I am using awk here.
Inside an awk script, I have a variable which contains a very long XML data in string format (500kb).
I want to pass this data (as argument) to curl command using system function.
But getting Too many arguments error due to length of string data(payloadBlock).
I... (4 Replies)
I want to print any matching IP addresse in List1 with List 2;
List 1
List of IP addresses;
161.85.58.210
250.57.15.129
217.23.162.249
74.76.129.101
30.221.177.237
3.147.200.59
170.58.142.64
127.65.109.33
150.167.242.146
223.3.20.186
25.181.180.99
2.55.199.32 (3 Replies)
Hi ,
we have a issue in server, we are running a perl script to connect our clients, but we are not able to connect, every time we are getting the
"Invalid argument error"
Even i checked all the necessary perl modules are i installed in this server,
#create the listen socket
my... (2 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
I have a wrote a script which consits of the below line.. Below of this script I'm getting this error "ksh: /usr/bin/ls: arg list too long"
The line is
log_file_time=`ssh -i $HOME/.ssh/id_rsa -q $i ls -lrt /bp/karthik/test/data/log/$abc*|tail -1|awk '{print $8}'`
And $abc alias is as "p |... (1 Reply)
Hi,
No need to say I'm new to unix shell scripting.
I have a very simple script that goes this way:
for datos in `ls -rt $UNXLOG/26-Jan*`
do
export arch=`echo $datos |cut -d, -f1`
if
then
export linea1=`grep Debut ${arch}`
export horatot=`echo $linea1 |cut -d' ' -f5`
... (7 Replies)
the code is below and the was run on Solaris 9.
-----------------------------
struct sched_param param;
param.sched_priority = 99;
if(sched_setscheduler(0, SCHED_RR, ¶m) == -1)
{
perror("setting priority");
exit(1);
}
-------------------------------
after the... (1 Reply)
Trying to tar specific files from a directory causes problems when the number of files is too large.
ls ~/logs | wc -l
5928
In the logs directory - I have 5928 files
If I want to include all files with today's date - I run the following command
tar cf ~/archive/LoadLogs_20060302.tar... (8 Replies)
I wish to remove a user from the system... but an error occurr...
I try to remove via SMITTY and try to remove via command line with
rmuser -p (name of user)
and does not works.... The system display that the "Name is too long"
There another way to remove a user... or... (1 Reply)