I am trying to give the option to the users to run the script in a different directory. However when the script changes the directory, the mkdir does not work.
I change the directory like this:
case $1 in
"-d")
PWD=$2;;
*)
;;
esac
but when I run the script, it runs in the directory that it exists.
Synopsis
cd [-L|-P] [DIRECTORY]
cd -
Description
The cd builtin command is used to change the current working directory
* to the given directory (cd DIRECTORY)
* to the previous working directory (cd -) as saved in the OLDPWD shell variable
* to the user's home directory as specified in the HOME environment variable (when used without a DIRECTORY argument)
Synopsis
cd [-L|-P] [DIRECTORY]
cd -
Description
The cd builtin command is used to change the current working directory
* to the given directory (cd DIRECTORY)
* to the previous working directory (cd -) as saved in the OLDPWD shell variable
* to the user's home directory as specified in the HOME environment variable (when used without a DIRECTORY argument)
Hi All,
I am new in using opensuse.
I wrote a simple shell script and the following error.
bash: /home/xi/bin/xxx.sh: /bin/sh^M: bad interpreter: No such file or directory
do I need to change the setting in bashrc? or I still do something incorrect.
thanks
I have a python script that looks files up in a relative directory. For example: the python script is in /home/username/projectname/. I have a file that is being called within the python script that is in /home/username/projectname/subfolder.
If I run the script from the shell as python scriptname.py it runs perfectly fine.
However, i'm trying to run the script as a startup service.
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.
My script contains five different scripts(Perl and shell) calling one after another.
I am experiencing the below error everytime a script calling another script.
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Although
When there is no .zshrc file in a user's home directory and zsh is started, an interactive configuration utility is run instead of directly giving access to the shell prompt.
I set up zsh to be the default shell on my Debian Wheezy systems. Therefore every newly created user gets zsh as login shell if I do not change that manually.
Write a bash script to produce the following screen:
The users home directory;
The users working directory;
List of processes owned by the user;
List of first twelve System Processes;
A count of the total number of processes running on Student UNIX;
This is the problem i have been given to do and would like some help with the code mainly for showing the users home directory and working direc