Sponsored Content
Full Discussion: Error as too many arguments
Top Forums UNIX for Dummies Questions & Answers Error as too many arguments Post 302908972 by wisecracker on Saturday 12th of July 2014 09:05:00 AM
Old 07-12-2014
Your error shows you have too many square brackets...
Code:
#!/bin/bash
echo enter name
read name
if [ "$name" == "b" ] || [ "$name" == "c" ]
then
	echo "$name"
else
	echo "none"
fi

Results; on CygWin at the moment hence dos2unix...
Code:
AMIGA:~> cd /tmp
AMIGA:/tmp> dos2unix readname.sh
dos2unix: converting file readname.sh to Unix format ...
AMIGA:/tmp> ./readname.sh
enter name
b
b
AMIGA:/tmp> ./readname.sh
enter name
c
c
AMIGA:/tmp> ./readname.sh
enter name
d
none
AMIGA:/tmp>_

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

arguments expected error

ive implemented getopt for the command line but have this problem, #!/bin/sh text="" set -- getopt "t" etc .... #sets arguments while : do case "$1" in #gets arguments -t: shift; text="$1" ;; shift done shift if then echo "no text" else echo... (4 Replies)
Discussion started by: strike
4 Replies

2. Shell Programming and Scripting

arguments too long error

Hi, I am running a .csh shell and get this error. set dir=/u21/oradata/SDE/cass echo /u21/oradata/SDE/cass /u21/oradata/SDE/cass set compression=jpeg set bustab=CASS_ORTHO2005 set keyword=cnty_2005 set resampling=bilinear set image_list=/u21/oradata/SDE/cass/*.tif Arguments too long.... (0 Replies)
Discussion started by: kburrows
0 Replies

3. UNIX for Dummies Questions & Answers

How to fix :[too many arguments error in code

I am getting a :; then echo "Enter zero or one file" echo "You must use a valid directory" echo "Current directory is:" pwd exit 0 fi #Flag Variable flag=1 #Code for no arguments if ; then for filename in * do if ; then ... (2 Replies)
Discussion started by: Brewer27
2 Replies

4. Shell Programming and Scripting

Getting error in command line arguments

Hi, When i am running the following script 1.sh (without giving the command line arguments) then i am getting the following error. if then echo "UID and PWD are correct" elif then echo "Either UID or PWD is wrong. Please check your UID and PWD" else echo "UID and PWD can't be blank"... (9 Replies)
Discussion started by: sunitachoudhury
9 Replies

5. Programming

Error: too many arguments to function 'sigwait'

#include <pthread.h> #include <signal.h> ... sigset_t mask; int err,signo; err=sigwait(&mask,&signo); switch(signo){ case SIGINT: ... } when I compile above code under solaris 10,it raise following error: error: too many arguments to function 'sigwait' I look up signal... (4 Replies)
Discussion started by: konvalo
4 Replies

6. Shell Programming and Scripting

Too many arguments error

I need help. I have created my script for a simple calculator but my multiplication operator does not work. This is the the code: #!/bin/bash echo "Enter number1" read Number1 echo"Enter number2" read Number2 echo"Operator is *" read opr if then expr $Number1 \*... (1 Reply)
Discussion started by: Pauline mugisha
1 Replies

7. Shell Programming and Scripting

Bash too many arguments error

Hello, I've got this little script that gets a bunch of comics and puts them in an html file. However, when I check that the comic URL is there and that it's a new one, I get the "too many arguments" error. The script is this: CADURL=`curl --silent http://www.cad-comic.com/cad/ | grep -o... (10 Replies)
Discussion started by: killer54291
10 Replies

8. Shell Programming and Scripting

Passing arguments--Error

Hi, i have a file.txt with data Bangalore Chennai Hyd filename of the script is: new.sh result=`cat file.txt | grep $1` if then echo pass else echo fail fi i am executing the file in the cmd line as "sh new.sh Bangalore" o/p is pass if i give "sh new.sh delhi" o/p is... (6 Replies)
Discussion started by: harsha85
6 Replies

9. UNIX for Dummies Questions & Answers

Too Many Arguments Error - shells script

Hi, I am getting the below error : error at the if condition start and when I print the value of TEST, it displays two values as below /home/xyz/out/file1.txt /home/xyz/out/file2.txt if ; then mv $TEST $TARGETDIR/ fi Tried by enclosing it in double quotes "$TEST",... (4 Replies)
Discussion started by: sudhagk
4 Replies

10. Shell Programming and Scripting

Too many arguments error

Here's my code. 21 if ; then 22 23 ls addr*.tmp | while IFS= read -r entry; do # Starts Reading .cfg files one by one ... 24 echo $entry I get the below error at line number 21 line 21: Can you tell me how can i alter my code to avoid the error ? (3 Replies)
Discussion started by: mohtashims
3 Replies
ppmtosixel(1)                                                 General Commands Manual                                                ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 09:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy