i am trying to access file email.txt in the script (directory of .txt file and the script is same)
!#bin/bash
total="$(wc -l < email.txt | tr -d ' ')"
echo "$total"
it's showing permission denied. Thankyou for any help
i am trying to access file email.txt in the script (directory of .txt file and the script is same)
!#bin/bash
total="$(wc -l < email.txt | tr -d ' ')"
echo "$total"
it's showing permission denied. Thankyou for any help
Well, there's at least one syntax error on your first character. Next give your script execute permissions,
$ cat test.sh
#!/bin/bash
total="$(wc -l < email.txt | tr -d ' ')"
echo "$total"
$ chmod 755 test.sh
$ ./test.sh
0
But then I have an empty "email.txt" file.