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

Questions tagged [bash]

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

0
votes
1answer
37 views

Using `ls` to show real name of file owners

Unix users can have their real names listed in /etc/passwd/. The finger command can display the real names. Can ls -l show these real names of file owners next to the files? If ls cannot do this ...
0
votes
0answers
10 views

How do I close a single instance of one application using bash?

I have three instances of RStudio running. Each instance is showing me a project. project1 project2 project3 How can I close one specific project (instance of RStudio) via Bash? I know how to ...
0
votes
0answers
24 views

Lookup-table text replacement in bash

We have weird usernames in our Linux system (like user0001). I would like to pipe results of ls -l through a lookup-table replacement of the weird usernames by their real names. I can make such a ...
0
votes
2answers
28 views

bash prompt messed up on arrow up

I have made some modification to my prompt with use of colors via tput. It looks like now when I try to do an arrow up lookup after few moves up, the prompt is being cut into half, what I mean by ...
0
votes
2answers
19 views

How to display colour text in terminal?

I want to display colour text in terminal(bash shell). Tried with this approach: echo -e "\e[1;31m This is red text \e[0m" But it doesn't change the text colour to red.
1
vote
1answer
15 views

find matched file_ids within the dat files in the directory and copy them to a different directory

I have a file_id = 840920 and I have to pick only the child files that belong to the file_id = 840920. The names of the dat file are different but within all the dat file, the parent file id is ...
0
votes
0answers
12 views

Can omxplayer receive keystroke if started by a service?

Debian w/ systemd. Here my autostart service: [Unit] Description=Autostart After=network.target [Service] ExecStart=/home/pi/bin/videoplayer.sh Restart=on-failure RestartSec=3 User=root Group=root [...
0
votes
1answer
31 views

Bash ignores zip -x arguments [duplicate]

The script below ignores all the -x exclude arguments when run from bash, but it works fine from command line: #!/bin/sh TIMESTAMP=$(date +%u) ulimit -s 65536 WEEK=`date +"%V"` if [ $(($WEEK%2)) -eq ...
0
votes
1answer
23 views

In bash scripts, is the brackets notation better than back-quotes?

When I learnt to write bash scripts, I put the output of a command in a variable using back-quotes, e.g., ALLPDFS=`find . -name \*.\[pP\]\[dD\]\[fF\]` but most of the 'official' scripts (the ones ...
-1
votes
1answer
30 views

Launching a Bash Shell from Powerpoint

Does anyone know of a way to launch a Bash Shell directly from a PowerPoint presentation? I've seen a lot of GOLANG Gophers running code from their powerpoint presentation (or at least I thought they ...
0
votes
0answers
23 views

Cygwin permission problems? Rsync works from command line but not inside a bash script [on hold]

I have a short bash script that runs a few rsync commands. I'm running this script in Cygwin (Windows 10). If I run the rsync commands directly on the cygwin command line, they work correctly (i.e. ...
0
votes
1answer
20 views

How to generate a SHA-256 hash in base64 format from commandline?

How do I generate a SHA-256 hash in base64 format from commandline? I want a piped commands kind of solution.
0
votes
0answers
30 views

Remount USB disk to read-only at MacOS. Flapping many disk

Script works perfectly if external device have one or two partitions, but if more all partitions many times remount. How to fix it? #!/bin/bash diskutil activity|while read line do if [[ "${line}" ==...
1
vote
1answer
57 views

How to get IP address and the connected interface name in bash

PC with onboard linux has several network interfaces, e.g. two ethernet cards and one wifi adapter (numbers and types may vary). Each of that interfaces could be connected to a network (and could be ...
0
votes
1answer
28 views

Pipeline after sourcing a bashscript

I have a code # Inside Child.sh ChildVariable=BigChild # Inside Parent.sh source ./Child.sh echo "ChildVariable=${ChildVariable}" Output: ChildVariable=BigChild But, # Inside Parent.sh source ....

15 30 50 per page