Questions tagged [shell]
The term 'shell' refers to a general class of text-based interactive command interpreters most often associated with the Unix & Linux operating systems. For questions about shell scripting, please use a more specific tag such as 'bash', 'powershell' or 'ksh'. Without a specific tag, a portable (POSIX-compliant) solution should be assumed, though using 'posix' in addition or 'sh' instead is preferable.
shell
109
questions
0
votes
1
answer
10
views
How to get the "source" command working in PowerShell?
I'm trying to execute the "source" command in PowerShell to activate a VM environment for python using Django but it won't let me. It brings up an error message of "source: The term '...
0
votes
1
answer
16
views
Is there a way to run Chrome browser on the command line so it blocks instead of being spawned?
for tessting a web app with a script I have
launch_test() {
spawn_local_test_http_server(port)
I want -> run_browser_with_url(where server is)
such that it will block until the user ...
0
votes
1
answer
20
views
Linux shell - Output ping to file and only keep last X lines
I want to write a shell-Script for my Raspberry Pi to permanently ping a specific host but only keep the last 20 results in a text file.
So my idea was to redirect the ping output to a text file and ...
0
votes
0
answers
25
views
Github CLI: repo counts without details
The --limit option of gh has an upper value limit. This is set to reasonable values, and for understandable reasons; as discussed here.
It can be convenient to format the output of gh as JSON, and ...
1
vote
1
answer
21
views
Runing shell script with python temporary environment variables
I am trying to find a way to run a python script with temporary env variables underground. I am using the following script to illustrate my approach, but it does not work.
example.py
import os
import ...
0
votes
0
answers
37
views
Shell script to add and commit in batch of files at a time [closed]
I will like to fix the issue where "git add" fails when a space is detected in the path file name. e.g source/code/data form/documents.txt. How can I update this script to allow file names ...
0
votes
1
answer
26
views
Configuring permissions to invoke tc qdisc shell commands requiring CAP_NET_ADMIN in C/C++ program
I have a C++ program that intends to set queuing disciplines by invoking (iproute2) tc shell commands.
Example code:
#include <iostream>
#include <cstdlib>
int main() {
const char* ...
-2
votes
0
answers
16
views
New relic for tomcat based application [closed]
I have one application and i want to integrate new relic java agent into that application ,i successfully injected new relic jfr into java based applications but for tomcat based application which ...
0
votes
1
answer
33
views
Extra padding in shell title view (IOS)
When using shell title view, an extra padding space is coming below title view only in IOS.
enter image description here
Code for TitleView
<Shell.TitleView>
<Grid ColumnDefinitions=&...
-1
votes
0
answers
13
views
Shell Script not able to access SSH_AUTH_SOCK environment variable
I am trying to build a docker image through a script, this script or any other script which I have tested with is not able to access SSH_AUTH_SOCK variable, when i echo in terminal it works, but when ...
-2
votes
4
answers
100
views
How to append some static content within a single cell of an existing CSV file
Let's assume I need to append the below content within the first cell (not be row by row) of the existing CSV file which has details of the customer. How can I achieve it?
Content to be added:
"...
-1
votes
1
answer
26
views
Calling `subprocess` in Python notebook has different `$PATH` than `!` shell
I am developing a wrapper class interactively in an IPython notebook. This wrapper class invokes a command line program written in java, and thus I need access to the same version of the java runtime ...
1
vote
0
answers
69
views
exit status of if statement in bash when condition is false
If I run help if in bash then it tells me that the exit status is "the status of the last command executed". Let's try it:
if false; then
echo we never get here
fi
echo $?
The last ...
0
votes
1
answer
21
views
Copy only *.log file [duplicate]
I have the below .ksh file. I just want to copy *.log file from parent_dir to target_dir while maintaining the folder structure and time stamp.
The below ksh copies EVERYTHING from source/parent_dir.
...
2
votes
3
answers
70
views
Using sed to remove differences in two arrays (updated ssh keys)
My aim is to updated automate the update of ssh keys in the authorized_keys file. Due to restrictions i am unable to use ansible which would have been a lot simpler.
Steps:
read keys from the file
...