"Arguments too long"


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers "Arguments too long"
# 1  
Old 08-12-2003
Data "Arguments too long"

Hi everyone,

I know this sounds stupid but on my Sun solaris machine I have csh script that finds all files 7 days older and then moves it to another area. The find works but the move I get "Arguments too long". I know that in c shell can not handel more 1706 arguments.

Quote:
find /iwp/itrexs/swift_in/processed/MTWPEXT* -mtime +7 -print
mv `find /iwp/itrexs/swift_in/processed/MTWPEXT* -mtime +7 -print` $dump
Can anyone give is tips on fixing this problem....I thought of ksh but I don't know how to do it Smilie

Pete
# 2  
Old 08-12-2003
Hi,
If you check the man page for find you will find a very nice little switch called -exec

check it out! It sould fix your problems!

example :
find ./ -mtime +7 -exec mv {} oldfiles/ \;

Will move all files with mtime +7 to oldfiles/

(the {} will be replaced by the filename) The -exec command will be runned for every file it finds..

Test it in a test environment before applying it to production data just to be on the safe side Smilie Better safe then sorry Smilie
/Peter

Last edited by s93366; 08-12-2003 at 07:12 AM..
# 3  
Old 08-12-2003
Smilie Hi s93366

I got it, Your idea was not for me.. I needed this for only controled areas not for the whole machine. I changed the script to ksh. varaibles "export set" insted of "set" and rest of the script was ok. below was my result.

Quote:
export dump=/usr/backup/clean_up
mv `find /usr/users/serv_lon/FRASETT*.alt -mtime +7 -print` $dump

thanks for the help

pete
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. Shell Programming and Scripting

Copy of "How to create a long list of directories with mkdir?"

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)
Discussion started by: setub
0 Replies

4. Shell Programming and Scripting

How to avoid "Too many arguments" error, when passing a long String literal as input to a command?

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)
Discussion started by: cool.aquarian
4 Replies

5. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

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)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

Command to view full data "export MAESTRO_OUTPUT_STYLE=LONG"

Hi, Always when I login to Unix, I need to give the following command to view the data properly; export MAESTRO_OUTPUT_STYLE=LONG The reason is that by default the settings export MAESTRO_OUTPUT_STYLE=SHORT Please let me know how I could make LONG as the default and avoid giving the... (1 Reply)
Discussion started by: jmathew99
1 Replies

8. Solaris

Compliation Error in solaris - macro "min" requires 2 arguments, but only 1 given

Hi, I am trying to compile our linux code base in solaris and came across the following issues. Am I suppose to do something special ? Can anyone help me to fix this issue. System : uname -a SunOS aspen 5.10 Generic_125100-08 sun4u sparc SUNW,Sun-Fire-280R The complier that I am using is... (0 Replies)
Discussion started by: learningkid
0 Replies

9. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
Login or Register to Ask a Question