Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a problem with the command :
tar cvf - `ls | grep -v "TAR" | grep -v "DMP" | xargs`| compress -c > file.Zerror 0403-027 the parameter list is too long
There is more on thousand files in the directory.
I hope you can help me
Thanks Gilles

I think it is xargs complaining about the lengthy parameter list. On that assumption, you could try using xargs -s nnnn to increase the argument list size.
If that doesn't work, you can avoid xargs by breaking into two commands:
tar cf file `ls|grep -ve "TAR" -e "DMP"`
compress filewhich will require a lot more interim disk space, although the same final disk space.
I used multiple arguments on a single grep to do the excludes, which is supported by XPG4 version. Otherwise, you can do two separate greps as you have shown.
James

![]() |
quota
|
restart shell script
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |