Sponsored Content
Full Discussion: too many arguments?
Top Forums Shell Programming and Scripting too many arguments? Post 302352204 by vgersh99 on Thursday 10th of September 2009 05:41:18 PM
Old 09-10-2009
put double-quotes around variables in your if-s.

---------- Post updated at 05:41 PM ---------- Previous update was at 05:41 PM ----------

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Arguments

Ok so i had to create a file and put some random text into it which i did. THen u make a script which takes 2 arguments. The first being a line of text, the second being your newly created file. The script should take the first argument and insert it into the very top (the first line) of... (1 Reply)
Discussion started by: iago
1 Replies

2. Shell Programming and Scripting

[: too many arguments

Hi Guys I have this small Bash script - but it fails when I'm trying to run it. ./test.sh: && ; then # date >> /writable/sys/shutdown.log shutdown -h "now" exit fi done (4 Replies)
Discussion started by: tainted2real
4 Replies

3. Shell Programming and Scripting

Too many arguments?

I can't find anything wrong with this line of code, it works when there is one file in the directory but more than one i get a "too many arguements2 error if ; then am i missing something? (3 Replies)
Discussion started by: Alendrin
3 Replies

4. Shell Programming and Scripting

[: too many arguments

hi I am getting too many arguments error for the below line if ; then Thx in advance (1 Reply)
Discussion started by: vls1210
1 Replies

5. Shell Programming and Scripting

Too many arguments

echo "the number from 1 to 10:" i=1 while do echo $i i=`expr $i+1' done above is the program i written in Linux O.S using vi editor but i am getting the error that while: line 3: i am not understanding that why i am getting this error. can any body please help me regarding this... (3 Replies)
Discussion started by: bsatishbabu
3 Replies

6. Shell Programming and Scripting

grep with two arguments to arguments to surch for

Hello, is it possible to give grep two documents to surche for? like grep "test" /home/one.txt AND /home/two.txt ? thanks (1 Reply)
Discussion started by: Cybertron
1 Replies

7. Shell Programming and Scripting

: [: too many arguments in for -f in if

Hi Experts , I have following code if ; then mv path /filename newdirpath echo "K* files moved successfully to newdirpath \n" else echo "K* files DID NOT moved successfully to newdirpath \n" fi I am getting "echo "K* files DID NOT moved successfully to newdirpath \n"... (19 Replies)
Discussion started by: ajaypatil_am
19 Replies

8. Shell Programming and Scripting

Using arguments

I have a SNMP agent that sends three arguments to the script to get a value at the end. The first is the LeafNumber, second is the request type (SET, GET, GETNEXT), and the last is a string that represents some value to be set(used only for set requests). The agent string looks like this: ... (3 Replies)
Discussion started by: jsoper1
3 Replies

9. Shell Programming and Scripting

Too many arguments

hi I have this code a="a b c" set -- $a if ; then echo empty fi why is it line 3 reports "test: [: too many arguments"? :wall: Thanks! (4 Replies)
Discussion started by: h0ujun
4 Replies

10. Ubuntu

[: too many arguments

line 5: #!/bin/bash old=$(du -sh /home/andy/Downloads/myfile.iso) while true; do new=$(du -sh /home/andy/Downloads/myfile.iso) if ; then break fi old=$new xdotool getactivewindow key Ctrl sleep 5 done line 5: bash - Meaning of " (square brackets)... (9 Replies)
Discussion started by: drew77
9 Replies
SETLEDS(1)						      General Commands Manual							SETLEDS(1)

NAME
setleds - set the keyboard leds SYNOPSIS
setleds [-v] [-L] [-D] [-F] [{+|-}num] [{+|-}caps] [{+|-}scroll] DESCRIPTION
Setleds reports and changes the led flag settings of a VT (namely NumLock, CapsLock and ScrollLock). Without arguments, setleds prints the current settings. With arguments, it sets or clears the indicated flags (and leaves the others unchanged). The settings before and after the change are reported if the -v flag is given. The led flag settings are specific for each VT (and the VT corresponding to stdin is used). By default (or with option -F), setleds will only change the VT flags (and their setting may be reflected by the keyboard leds). With option -D, setleds will change both the VT flags and their default settings (so that a subsequent reset will not undo the change). This might be useful for people who always want to have numlock set. With option -L, setleds will not touch the VT flags, but only change the leds. From this moment on, the leds will no longer reflect the VT flags (but display whatever is put into them). The command setleds -L (without further arguments) will restore the situation in which the leds reflect the VT flags. One might use setleds in /etc/rc to define the initial and default state of NumLock, e.g. by INITTY=/dev/tty[1-8] for tty in $INITTY; do setleds -D +num < $tty done OPTIONS
-num +num Clear or set NumLock. (At present, the NumLock setting influences the interpretation of keypad keys. Pressing the NumLock key com- plements the NumLock setting.) -caps +caps Clear or set CapsLock. (At present, the CapsLock setting complements the Shift key when applied to letters. Pressing the CapsLock key complements the CapsLock setting.) -scroll +scroll Clear or set ScrollLock. (At present, pressing the ScrollLock key (or ^S/^Q) stops/starts console output.) BUGS
In keyboard application mode the NumLock key does not influence the NumLock flag setting. SEE ALSO
loadkeys(1) 24 Sep 1994 SETLEDS(1)
All times are GMT -4. The time now is 05:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy