pushd > /dev/null permission denied in .zshrc [closed] - linux

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I'm using the commands pushd and popd in my .zshrc. I don't want these two commands to print anything to the console.
Therefore I tried to use it this way: pushd > /dev/null.
But now the output is: permission denied: /etc/null.
> /dev/null/ works for all other commands directly typed into my console (this tells me, that the permissions on /dev should be set correctly).

As Keith Thompson mentioned, I accidentally typed > /etc/null instead of > /dev/null
Fixing that typo solved my problem.
I should have better read the output:
permission denied: /etc/null

Related

jq doesn't grab correct file in a json [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed last month.
Improve this question
I have a package.json
{
version: "1.0.0",
}
And below is my content
version=$(jq -r '.version' package.json)
echo version
of my bash.sh file, but I couldn't get the '1.0.0', I got version printed on my terminal, any clue why?
Assuming this is bash, you are missing a dollar sign on this line:
echo $version
so you are printing a string instead of referring to a variable.

Bash script returning command not found, when setting the PATH [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed last year.
Improve this question
I am very new to Linux and Bash scripting. Also my first question on stackoverflow.
I am trying to create a bash script which I want to use from any directory.
So far this is what I did
Created a simple bash file first
#!/usr/bin/bash
echo "This is a bash script"
exit 0
I set the permissions for execute using chmod +x myfilename.sh
And then I edited the .profile file under ~/.profile
Added the line "export PATH="$PATH:$HOME/bash_course/scripts"
After that I ran the command source ~/.profile
Now I tried to run myfilename from the terminal, but it returns Command not found.
Any idea what could have gone wrong?
I checked the path of my bash and it is /usr/bin/bash
If I run ./myfilename.sh from file path, it is working. But I am trying to run from other directories.
FYI : I am doing all of this on a WSL
Found the issue. My path was actually /bash-course/scripts and not /bash_course/scripts
I corrected the exported path under .profile
Thanks everyone

Every command is returning 'bash: <command>: command not found...' [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I just installed Scala and added the path with gedit ./bashrc:
export SCALA_HOME=/home/avijit/scala-2.12.2
export PATH=$SCALA_HOME/bin:PATH
but since then, no command is working:
[avijit#localhost-localdomain ~]$ ls
bash: ls: command not found...
I gave the full path but:
[avijit#localhost-localdomain ~]$ /home/avijit/.bashrc
bash: /home/avijit/.bashrc: Permission denied
Even vi is not working so that I can fix the mess in the path.
[avijit#localhost-localdomain ~]$ vi /home/avijit/.bashrc
bash: vim: command not found...
[avijit#localhost-localdomain ~]$ sudo /home/avijit/.bashrc
bash: sudo: command not found...
[avijit#localhost-localdomain ~]$ echo $path
<- returned blank line
I tried many steps from different forums but no luck. How can I fix this?
Problem is with export PATH=$SCALA_HOME/bin:PATH in this you missed $.
Update default variable as PATH=$SCALA_HOME/bin:$PATH

Bash - Terminal Error: "-bash: export: `GOPATH~/usr/go': not a valid identifier" [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
I am currently learning the Go programming language. And I followed a sequence of video tutorials on youtube for installation.
I inputted this line in the terminal:
echo "export GOPATH~/Users/Guest/Documents/go" >> .bash_profile
And when I opened the terminal again, below error is displayed at the top:
-bash: export: `GOPATH~/Users/Guest/Documents/go': not a valid identifier
Is there a way on how to fix/remove the error?
There's a typo in the command. Edit .bash_profile and change the command to:
export GOPATH=/Users/Guest/Documents/go

Multiple nohup process writing output to same file [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I want to run multiple background processes through ssh, aggregate all outputs and errors to the same file and redirect the logs to papertrail using remote_syslog
Following this answer i execute a ruby script in background like this :
ssh deploy#xx.xx.xxx.xx 'cd path/to/my_app; nohup ruby my_script.rb > log/script.log 2> log/script.log < /dev/null &'
It works as long as i only run one script. If i run multiple scripts i only see the output of the first script in the log file.
Can you explain what i'm doing wrong ? Or provide a better way to achieve this. Thanks !
(the log file is in path/to/my_app/log/script.log)
Solution :
Thanks to devnull comment i solved it, it was so simple... The proper command is :
ssh deploy#xx.xx.xxx.xx 'cd path/to/my_app; nohup ruby my_script.rb >> log/script.log 2>> log/script.log < /dev/null &'

Resources