How to fix command not found error and what is too many argument error.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to fix command not found error and what is too many argument error.
friends,
i am a begginner to shell script.i myself do a project in shell script.And obviously facing some problem.
first, i develop 2 general files and then other files are developed.2 general files are used in all my other files.But when i run these other files i found command not found error comes.i have gone through ur forum.But i did not get any proper solutions.Not only that,i also got too many argument error.If needed i can also send my code.
Hi,deep27ak,
Yhank u for ur quick response.These are my codes of 2 general files.
I am using linux 2.6
File=1 for writecentre
-------
#!/bin/bash
if [ $# -ne 3 ]
then
echo improper arguments
exit
fi
case $attr in
[bB])echo -n "\033[1m$str";;
[nN])echo -n $str;;
[rR])echo -n "\033[7m$str";;
esac
echo -n "\033[0m"
File 2 for writec
-------
if [ $# -ne 4 ]
then
echo improper arguments
exit
fi
str="$1"
row=$2
col=$3
attr=$4
tput cup $row $col
case $attr in
[bB])echo -n "\033[1m$str";;
[nN])echo -n "$str";;
[rR])echo -n "\033[7m$str";;
esac
echo -n "\033[0m"
And these two files are used for writecentre and writec commands that i use in all my other files.
When i run these two files in bash shell ,i get o/p as improper arguments.
ok,after that when i use these 2 files in my other program ,it gives writecenter & writec command are not found.
And these r the codes where i use my 2 files .
MASTER=$HOME/emaster.dbf
TRAN=$HOME/etran.dbf
...............
............
...............
while true
do
clear
writecenter"payroll processing system" 7 "B"
writec"your choice?" 15 30 "N"
...............
...........
.........
esac
done
Thak U
Deepak
Last edited by deepakunix; 01-13-2012 at 08:25 AM.
I did not understand what's your problem well, but I think adding your '2 gerneral scripts' to your PATH Environment variable can fix this problem ...
or you can point to them with thier full path.
suppose that your '2 gerneral scripts' are located at /home/foo/bin
you can add them to the environment variable by editing the bash_profile file in /home/foo/bash_profiles
edit the $PATH by adding the directory /home/foo/bin
your $PATH may not look like this ... so don't edit anything yet
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
just add at the end of the line :/home/foo/bin
so it becomes PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:/home/foo/bin
then save the file and reload it
$# source /home/foo/.bash_profile
If I understood your problem right that may help.
Or you can point to your '2 gerneral scripts' with thier full path in the 'other files are developed'.
I will try all the things to set my enviormenatal variable.But i can not find any solution.
1)First i try to the path in last to my general script,but the result is same.
2)Then i came to command prmpt to give the path as echo $path,but no result
3)Then i give the path in my general script in first line,then it gives the error that path is not a command.
4)Then,i give the path in my files ,but no result.
Overall,my problem is i donot know how to set the path.
so,please give me an example ,so that i can understand how to set the environmental variable.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.