I did this from the ~ directory. I typed this command sudo gedit .bashrc then I appended these lines to the file and saved it. Now when I open the terminal I get the following error: Its good that I have fish installed else I wouldn’t have been able to use the terminal. Please help me solve this error. Answer
Tag: bash
How to get user from init bash script Linux(before user session created)
At Debian im trying to change specific directory ownership after every reboot. But in my case it doesnt work, because user always set as root at reboot time. When i try this in terminal it works well (i think because myUser session created) but i need to change it at reboot time. So far i refer this link but it
Output was lost in linux terminal. How do I restore? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question
How to grep text patterns from remote crontabs using xargs through SSH?
I’m developping a script to search for patterns within scripts executed from CRON on a bunch of remote servers through SSH. For now I can’t get the correct output. Script on client machine This only gives me the paths of scripts from crontab, not the matched lines and line number plus the first line is prefixed with “grep:” keyword (example
Sudo gets separate PID when starting a command
I do not understand why sudo gets a separate PID (e.g. 1620) while starting dockerd (e.g. 1628) with sudo? To which PID should I send SIGTERM to stop the dockerd? ps aux | grep dockerd pstree -ps Answer I do not understand why sudo gets a separate PID (e.g. 1620) while starting dockerd (e.g. 1628) with sudo? It is just
Find and copy specific files by date
I’ve been trying to get a script working to backup some files from one machine to another but have been running into an issue. Basically what I want to do is copy two files, one .log and one (or more) .dmp. Their format is always as follows: something_2022_01_24.log something_2022_01_24.dmp I want to do three things with these files: find the
How can this bash script be made shorter and better? Is there a way to combine multiple curl statements and if statements in bash?
The main script is scheduled and runs everyday and prints the success message everytime. If the status code is anything other than 200, $Status_code_1 or $Status_code_2, whichever is down prints the error code. The code is working fine but I want to know how can it be made shorter. Can the curl command from first 2 lines be combined because
My raspberry Pi Won’t let me log in as a superuser [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question
prompt and read a value as input for shell script
I am trying to create a shell script where it should prompt and read the values as input and then update the same shell script with that value in a specific line and column. Or if i can use another shell script to get the values and update original file. i wanted to read and update below parameters values as
Zsh bad substitution error when installing Influxdb2.0
I am following the installation instructions from this article but I get a bad substitution error from zsh when executing this command: What am I supposed to change for zsh? Answer ${DISTRIB_ID,,} is a Bash-specific parameter expansion to lowercase the value of the variable. https://askubuntu.com/a/383360/25077 suggests ${(L)DISTRIB_ID} as a corresponding operation in Zsh. But there is no real reason for