Reputation: 384
I am writing a script in linux and when I run it, it seems like it is trying to run every line as a command?
My script is like this
#!/bin/bash
#add user script
clear
curUser = "$(whoami)"
Welcome to the user management application, $curUser.
1.)Add User.
2.)Modify User.
3.)Delete User.
4.)See Last 10 User Created.
5.)Quit
I did chmod +x Manage-Users.sh
ran it with ./Manage-Users.sh
my output is this : ./manage-users.sh: line 4: curUser: command not found. There are a couple other lines with similar outputs. Why is this happening?
Upvotes: 1
Views: 31
Reputation: 440
Have you tried removing the space before and after the assignment operator = ?
That line could be written as: curUser="$(whoami)"
Upvotes: 1