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 [shell]

A shell is software that lets users interact with the operating system, usually by typing at a command-line.

-1
votes
1answer
41 views

Allegedly good method to change the default shell in Cygwin doesn't work for me. Why?

I'm trying to get Cygwin (CYGWIN_NT-6.1 / 2.11.1(0.329/5/3)) to start with tcsh as default shell on Windows 7. I read this question and answers there but had some issues with the mintty method ...
1
vote
2answers
41 views

Is it POSIX-compliant to use a shell function in a pipeline?

Is it possible to use a shell function in a pipeline? Say I had a function that acted like grep, called mygrep. Is there any way, using only POSIX shell features, to be able to invoke mygrep like ...
3
votes
2answers
46 views

In Linux command manuals, what is the difference between having in the description a “short_option <comma> long_option” and “short_option long_option”

For instance, taking a look at man stat in the description, there's several options like: -L, --dereference and -c --format=FORMAT what is the difference with or without a comma? And how ...
2
votes
1answer
29 views

How do I check whether a CD is currently in use on Linux?

How do I check whether a CD is in use before I remove it from the VM? It's currently mounted on /dev/sr0 on a Ubuntu 14.04 machine and I need to unmount it for datastore migration. I know it's not ...
1
vote
1answer
37 views

How to send sudo password in a shell script

My shell script (don't have EXPECT, and is not possible) runs a shell script impersonating another user. Let's say the following script is named toto1.sh and is run with a user called MYUSERNAME1. #!/...
0
votes
1answer
28 views

How to execute .sh file (raspberrypi) that is present in someother folder

Sh file name: runme.sh Path: /home/pi-bridger/ I wanna run a .sh script that is under /home/pi-bridger/. I am able to run it inside the folder by using the command ./runme.sh. I wanna run the script ...
0
votes
0answers
28 views

How to write bash script that handles 3 different set of “inputs”

I'm trying to make my .sh file, able to accept 3 different ways of obtaining a path to a file plotted by the user. If no filepath / env-variable (how do I set this up properly?) is given as arg in ...
-1
votes
0answers
22 views

Automating launches of several bash terminals in windows [closed]

At my company, in order to fully launch our application we need to start up 5 to 8 git bash terminals on a daily basis (things like elasticSearch, kibana, neo4j, npm... but also our own scripts). ...
0
votes
0answers
12 views

Is it possible to provide SSH credentials for sourcetree via ssh -A xxx@123.456.7.89?

Is it possible to provide SSH credentials for sourcetree via ssh -A xxx@123.456.7.89 ? Meaning using the ssh client of my MacBook in SourcTree on my working desktop by forwarind the authentication ...
84
votes
10answers
19k views

What is the purpose of 'tee'?

All the usages of tee I ever saw were such: do_something | tee -a logfile Or: do_something_else | tee logfile Is tee invented for those that don't know you can do the same with shell pipe ...
1
vote
1answer
24 views

~/.bash_profile not source from symlinked login shell

If I call bash --login Then ~/.bash_profile is called. This seems as it should. I also have /bin/sh symlinked to bash $ ls -l /bin/sh lrwxrwxrwx 1 root root 4 Jun 22 2017 /bin/sh -> bash ...
1
vote
1answer
28 views

How to extract multiple urls from String?

I have a string like below https://website.com/BTAE/2015/BTAE assignment jan 15.pdf²0ÔË'\„QI„"ÙP¾^ŒŸZ‡@Æ*]Ü.^‚vðƒ€Ù¾»Æš©Šñ‘€é• ªÂIR#œÉgÉÛ^gMdÉ%9¬e˜Hžôb¿'0<ô ?lþzk…éÃÄórÈ;EW¦K³1…²ì¶ZFžŠÒô*ÄÖ\...
1
vote
2answers
33 views

How to merge multi-line output to form a single line?

I want to join different line output to a single line like below. $ cat new.txt | grep Full | awk '{print $1}' 09/01/2018 08/25/2018 08/18/2018 08/11/2018 08/04/2018 07/28/2018 07/21/2018 I want ...
0
votes
1answer
26 views

Perform SSH remote cmd exec on multiple local servers from input (sshpass?)

I am currently looking for a solution for executing remote commands on multiple local servers from an input file containing the 'user : password' in the following format: jboss5:manager:192.168.1.101 ...
0
votes
0answers
11 views

Where to find the meaning of each color coming out of `ls --color`?

Different shells have different colors for different things. Where exactly are those colors assigned? For example, when I ls, I get two similar files but with different color and I would like to know ...

15 30 50 per page