1

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?

Craig
  • 364
  • 1
  • 3
  • 25
  • possible duplicate of [Basic bash script variable declaration - command not found](http://stackoverflow.com/questions/2268104/basic-bash-script-variable-declaration-command-not-found) – chepner Nov 25 '14 at 18:15

1 Answers1

1

Have you tried removing the space before and after the assignment operator = ?

That line could be written as: curUser="$(whoami)"

mayank_io
  • 440
  • 5
  • 8