Quote it from where you are sending.... Again quoting is the answer.
Example:
Process 1: Get and prints the argument.
Code:
$ cat get-arg.sh
echo $1 $2
File: f1 is the file which has the given content
Code:
$ cat f1
products/100% Haddock Fillets 500G-small.gif
products/100% Haddock Fillets 500G.gif
products/2 Hot and Spicy Grills 200G -small.gif
products/2 Hot and Spicy Grills 200G.gif
products/2 Original Fillet Burgers 180G -small.gif
products/2 Original Fillet Burgers 180G.gif
Process 2: Reads lines, and calls the other process with the argument.
Code:
$ cat t1.sh
while read line
do
#echo $line
sh ./get-arg.sh "$line"
done < ./f1
Note: When "" around line is there then it had been taken as a single argument...
I hope you have got it now as because i demonstrated enough ....
If needed, give without QUOTE in $line, then you will printing only first two words...
With Quote:
Code:
$ sh t1.sh
products/100% Haddock Fillets 500G-small.gif
products/100% Haddock Fillets 500G.gif
products/2 Hot and Spicy Grills 200G -small.gif
products/2 Hot and Spicy Grills 200G.gif
products/2 Original Fillet Burgers 180G -small.gif
products/2 Original Fillet Burgers 180G.gif
Without Quote:
Code:
$ sh t1.sh
products/100% Haddock
products/100% Haddock
products/2 Hot
products/2 Hot
products/2 Original
products/2 Original
I do ls -l ABC*, I get arg list too long message. This will not happen if ABC* has small no of files I believe 4000 files is limit. Any way of avoiding this.
I even tried like this
for i in `ls -l ABC*`
do
echo $i
done
Same problem.
Any solution would be great.
I am on HP-UX... (5 Replies)
Aix 5.2 on a P510 RS6000
My /usr filesystem is sized at 3.8 gb. Check me if I'm wrong here but this should be enough space for /usr?
When I installed the o/s I just followed the defaults, didn't add any 3rd party apps, least that I know of.
My problem is that it's running at 90% capacity. ... (2 Replies)
Hi,
Help. I have a file that contains a list of users in a file. I want to cat the content of the file and feed it into sed to a preformated report. The error I got is "ksh: /usr/bin/sed: arg list too long" My method below.
A=`cat FILE1.txt`
B=`echo $A`
sed "s#USERLIST#$B#" FILE2 >... (2 Replies)
Hello All,
I am trying to find a file name with .sh exention from a list of .dat files inside a directory.
find /app/folder1/* -name '*.dat'| xargs grep '.sh'
ksh: /usr/local/bin/find: arg list too long
Please help me finding the command.
Thanks (3 Replies)
Hello, I've just started with shell scripting, and I need som assistance!
Basicly what I want to do is copy names from one file to another, when running the scrip the user should be asked about the status of these names.
Let me demonstrate:
file:
Name: John, Gender: male
Name: Jane,... (6 Replies)
I have a simple bash script on RHEL that works fine when there is one file but when it finds multiple files of same condition I get too many args error.
for i in *
do
if ;then
echo "no files to move"
exit 0
fi
if ; then
... (10 Replies)
Hello,
I am trying to execute remote script with ssh :
ssh -o ConnectTimeout=10 -o PasswordAuthentication=no -o NumberOfPasswordPrompts=0 -o StrictHostKeyChecking=no root@host '/arbo/script -t'
My script is well executed, but my option '-t' is never loaded, how can you explain that ? (2 Replies)
Discussion started by: cterra
2 Replies
LEARN ABOUT DEBIAN
setup.types
setup.types(5) Easy Software Products setup.types(5)NAME
setup.types - epm gui setup types file format.
DESCRIPTION
The EPM setup program normally presents the user with a list of software products to install, which is called a "custom" software installa-
tion.
If a file called setup.types is present in the package directory, the user will instead be presented with a list of installation types.
Each type has an associated product list which determines the products that are installed by default. If a type has no products associated
with it, then it is treated as a custom installation and the user is presented with a list of packages to choose from.
FILE FORMAT
The setup.types file is an ASCII text file consisting of type and product lines. Comments can be inserted by starting a line with the pound
sign (#). Each installation type is defined by a line starting with the word TYPE. Products are defined by a line starting with the word
INSTALL:
TYPE Typical End-User Configuration
INSTALL foo
INSTALL foo-help
TYPE Typical Developer Configuration
INSTALL foo
INSTALL foo-help
INSTALL foo-devel
INSTALL foo-examples
TYPE Custom Configuration
In the example above, three installation types are defined. Since the last type includes no products, the user will be presented with the
full list of products to choose from.
SEE ALSO epm(1) - create software packages
setup(1) - graphical setup program for the esp package manager
COPYRIGHT
Copyright 1999-2007 by Easy Software Products, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER-
CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
3 April 2006 ESP Package Manager setup.types(5)