I am trying to create few scripts that would change the working directory of the main shell/terminal. Not able to do so. I tried the following
File p1.sh
#!/bin/bash
cd /home/mtk/work/project1
File code.sh
#!/bin/bash
cd /home/mtk/templates/resusable/sampleCodes
But I am aware that the above would change it only for itself i.e.
When I log in, appears the following error:
-bash: /etc/profile: line 1: syntax error near unexpected token ('
Inside the file there is the next code:
n# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))\n
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).\n\nif
[ -d /etc/profile.d ]; then\nfor i in /etc/profile.d/*.sh; do\nif [ -r $i ];
then\n.
I think it's gnome terminal, whatever the default that comes with Ubuntu is. I'm using version 12 and it has the icon "Terminal" as the application name.
I had a terminal profile set up with all my preferences and that worked fine for a couple of days. I'd click on the icon marked "Terminal" and the terminal would launch with my settings.
Can't change my user bash prompt color, while root prompt does work correctly and changes colors whenever I edit /root/.bashrcMy root and user .bashrc are identical except for the colors:# Check for an interactive session
[ -z "$PS1" ] && return
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1='\[\e[1;33m\][\u @ \@ \w]\$ \[\e[0;32m\]'
#setup
Can't change my user bash prompt color, while root prompt does work correctly and changes colors whenever I edit /root/.bashrcMy root and user .bashrc are identical except for the colors:# Check for an interactive session
[ -z "$PS1" ] && return
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1='\[\e[1;33m\][\u @ \@ \w]\$ \[\e[0;32m\]'
#setup
Can't change my user bash prompt color, while root prompt does work correctly and changes colors whenever I edit /root/.bashrcMy root and user .bashrc are identical except for the colors:# Check for an interactive session
[ -z "$PS1" ] && return
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1='\[\e[1;33m\][\u @ \@ \w]\$ \[\e[0;32m\]'
#setup
Can't change my user bash prompt color, while root prompt does work correctly and changes colors whenever I edit /root/.bashrcMy root and user .bashrc are identical except for the colors:# Check for an interactive session
[ -z "$PS1" ] && return
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1='\[\e[1;33m\][\u @ \@ \w]\$ \[\e[0;32m\]'
#setup
I have a script on a server-A
Script-A
#!/bin/bash -l
echo "script-A.sh" | change-environment.sh
When I ssh onto server-A and execute it, it works fine.
However, when I
ssh user@server-A ./script-A.sh
Script-A executes, but throws an undefined variable error in change-environment.sh.
I'm trying to permanently change my shell to zsh using chsh command, but it's not working.
zsh is installed (via apt) and works fine when I invoke it directly from a bash prompt terminal.