My /etc/profile code is:
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ "$PS1" ]; then
if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
.
Terminal shows this
bash: /home/atlas/.bashrc: line 73: syntax error near unexpected token ['
bash: /home/atlas/.bashrc: line 73:if [ -x /usr/bin/dircolors ] ; then '
I've tried to fix it using
"cp /ect/skel/.bashrc ~/"
And I get this "cp: cannot stat `/ect/skel/.bashrc': No such file or directory"
I'm unsure of why this is doing this and how to fix it.
The bash man page says:
"When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc and ~/.bashrc, "
I can see that bash.bashrc is executed because I put echo in it, but .bashrc is not.
I have a .bashrc file that has a very simple function like this
function module() {
....
}
I type "bash" on the command prompt and as expected the .bashrc gets executed however I get the error:
'ash: /user/.bashrc: line 1: syntax error near unexpected token `{
'ash: /user/.bashrc: line 1: `function module() {
I have tried removing the word "function" and I have also tried removing the ()
I'm trying to install RVM on 12.10 by running this command in terminal
$ curl -L get.rvm.io | bash -s stable
and I got this error
bash: line 1: html: No such file or directory
bash: line 2: syntax error near unexpected token
bash: line 2: 400 Bad Request
Here's the link to the script: https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer
Any help?
I have a .bashrc file that has a very simple function like this
function module() {
....
}
I type "bash" on the command prompt and as expected the .bashrc gets executed however I get the error
'ash: /user/.bashrc: line 1: syntax error near unexpected token `{
'ash: /user/.bashrc: line 1: `function module() {
I have tried removing the word "function" and I have also tried removing the ()
I am currently trying to write a bash script which helps me step through a directory and check for .jpeg or .jpg extensions on files.
when I run from bash shell the command:
bash
for i in 1 2 3 ; do echo $i ; done
1
2
3
but when I switch to tcsh and want to run:
tcsh
bash -c for i in 1 2 3 ; do echo $i ; done
i: -c: line 1: syntax error near unexpected token `newline'
i: -c: line 1: `for'
i: Undefined variable.
please advice why I get errors ( I run the for loop from bash -c its the same ?
and what I ne
How can I find out whether a script is written in bash or sh?
The first line of the script is not helpful here, since on Linux, bash scripts have this line:
#!bin/sh
Actually, there are many distribution where bin/sh is bash (maybe bin/sh is a link to bin/bash in those distributions), and not Bourne Shell.