Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Bash is a free shell for Unix-like operating systems from the GNU Project.

0
votes
1answer
11 views

append to end to line without newline

When i try to append to the end of a file it creates a new line. Now I have tried to fix this with echo -n but that doenst work. So what am I trying. I'm trying to get the following result: Hello ...
0
votes
0answers
11 views

Use .bashrc in a detached screen

So, I've got a bunch of export ... environment variable lines in my .bashrc, and I would like to call some programs (specifically Jupyter notebook) that need access from those notebooks from screen, ...
1
vote
0answers
14 views

Wrap the history number - reset history number without losing history

I display the history number as part of my prompt, e.g., {!1123}(j:~)$ ls /some/long/and/hard/to/type/path so that I can do it later with !1123. My HISTSIZE and HISTFILESIZE are both 200, but this ...
0
votes
0answers
19 views

Why crontab job stopped during running?

last year it can generate *Error.txt files and no limit this year only add new switches in new project and changed to new security manager. what is wrong in syslog server? Linux version 2.6.32-573.22....
0
votes
1answer
31 views

Bash Script to Eject unencrypted USB drive

I need to forcibly eject any USB drive that is not encrypted. I have a script already that ejects any USB drive, but I need to modify it to check the encryption status of the disk before ejecting. ...
0
votes
1answer
18 views

Awk , but print only a portion of a field

I am concerned with only a portion of a particular field (hostname) in a log line and would like to print all the unique occurrences of said portion. I am currently doing something like: zcat $...
0
votes
0answers
12 views

How to resolve output result from crontab different with the output result by manually running the script?

How to resolve if output result in text file from crontab is different from the output result when i manually run the script in Linux? Example : Ifconfig output from crontab is empty. Thanks! ...
0
votes
2answers
26 views

Why do I need to set execute permissions to run a bash script when it can run if I force it with “bash test.sh?”

These are the contents of test.sh: #!/bin/bash echo "test me" To execute with bash test.sh,no problem. But to execute with ./test.sh,an error occur: bash: ./test.sh: Permission denied chmod u+x ...
2
votes
1answer
26 views

Duplicating stderr output and merge with stderr in bash without changing order

I want to write both stderr and stdout to a log file, and print stderr to the terminal (or default output device). Motivation: I have a command in my crontab, and I want to log all of its output to a ...
0
votes
1answer
100 views

Installing/Updating Programs on Server

I'm accessing my server, which is hosted by JustHost, via a SSH in order to install Selenium in order to do some web-scraping. I've run into an issue while trying to install it, however. Judging by ...
3
votes
0answers
19 views

TAB completion with .bash_history

I usually use PageUp/PageDown to search through .bash_history given a prefix. However, I regularly catch me pressing TAB multiple times before realizing that I need to use PageUp/PageDown in this ...
0
votes
1answer
25 views

can't increment a variable inside a loop in a bash script

I am running a bash script in Ubuntu 18.04. The script needs to run a python script 10 times. I did the following testbash.sh script: #!/bin/sh count=1 while [ $count -le 9 ] do python /home/e/...
0
votes
1answer
7 views

Rsync from “files-from” list but also delete extraneous files in destination

I'm using rsync to load my mp3 player with music from a text file, and as such I'd like to delete extraneous files that aren't included in the "files-from" list. (Say if I no longer want a particular ...
0
votes
0answers
25 views

How do I replace PATH Environment variable items to double quote those which have spaces?

I am looking for a short command which I can execute in the Windows 10 command shell (cmd) or in powershell or in git-bash for Windows, which would replace PATH Environment variable items to double ...
1
vote
1answer
16 views

Bash finding old version of executable in /usr/bin after installing into /usr/local/bin, why?

I installed a new executable into /usr/local/bin and this directory is in my path ahead of /usr/bin . But, bash still prefers the version in /usr/bin until I start a new bash process. The which ...

15 30 50 per page