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
92,895
questions
0
votes
0
answers
21
views
How do make a custom command to be executed directly from a folder using bash
I want to create a custom command that executes a bash script when a use types it in the terminal. So for example when they type in project setup it executes the setup bash script and then they can ...
-1
votes
0
answers
22
views
source $HOME/.bash_profile does not save the Output after reboot
I have created a simple Shell script using the below commands.
# Setting the JAVA_HOME PATH in .bash_profile. NOTE: - We need to run this only if we are downloading the Java and running it manually. ...
10
votes
3
answers
3k
views
How to call a function (defined in shell script) in a Perl script
I have two scripts, namely shell_script.sh and perl_script.pl.
shell_script.sh : It has function definitions which, when invoked from Perl script, will execute certain commands on Linux in batch ...
0
votes
0
answers
9
views
Jenkins withcredentials
I have a script which contains git clone, however I saved the credentials using jenkins UI under jenkins credentials so whenever I check out normally I use withcredential, so how can I run the script ...
41
votes
5
answers
72k
views
Running shell script using .env file
I am fairly new to running scripts in UNIX/Linux. I have a .env file containing environment information and a .sh script containing folder creations etc for that environment.
How would I run the ...
1
vote
0
answers
19
views
How could I execute arbitrary code from an appShell command button (instead of showing a view)?
I have an appShell like this:
<?xml version="1.0" encoding="UTF-8" ?>
.......
<TabBar
x:Name="MyTabBar"
Route="Home"
&...
-1
votes
1
answer
34
views
Any way to run a script on Linux VM connected via SSH from a python program
I am connecting to linux machine via below code
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname, port, username=username, password=...
107
votes
14
answers
77k
views
How to split a file and keep the first line in each of the pieces?
Given: One big text-data file (e.g. CSV format) with a 'special' first line (e.g., field names).
Wanted: An equivalent of the coreutils split -l command, but with the additional requirement that the ...
0
votes
0
answers
11
views
Terminal Opened in Ubuntu but command prompt not appear
When I open my terminal in Ubuntu, it opens, but I have no command prompt! I can't write any commands. I tried to reset it, but nothing happened. The terminal stays like that, so what should I do?
The ...
190
votes
21
answers
244k
views
How to sort an array in Bash
I have an array in Bash, for example:
array=(a c b f 3 5)
I need to sort the array. Not just displaying the content in a sorted way, but to get a new array with the sorted elements. The new sorted ...
1
vote
2
answers
4k
views
Spinner Animation and echo command
This is a part of my bash file. The output I need is:
[ - ] Copyright of KatworX© Tech. Developed by Arjun Singh Kathait and Debugged by the ☆Stack Overflow Community☆
I want the spinner animation ...
0
votes
1
answer
9k
views
Error: Unable to access jarfile ERROR MESSAGE
I have a MyFolder folder with a "run" script and a .jar file to execute.
My script is this:
!/bin/bash
clear
java -jar ./PokerGame-1.0-SNAPSHOT.jar
And insider the folder Myfolder I have:
...
830
votes
33
answers
755k
views
Why can't I change directories using "cd" in a script?
I'm trying to write a small script to change the current directory to my project directory:
#!/bin/bash
cd /home/tree/projects/java
I saved this file as proj, added execute permission with chmod, ...
0
votes
3
answers
50
views
Pass bash variable to jq filter and echo the whole command to another variable
I have a sample json like this /tmp/test.json
{
"foo" : "val1",
"bar" : "val2"
}
Setting the key in a variable
key=foo
cat /tmp/test.json | jq --arg k $...
-1
votes
0
answers
23
views
linux send mail configuraiton [closed]
I'm trying to send html email with sendmail plugin on linux. But I need to set smtp server url how can I set while sending this mail.
(
echo "To: [email protected]"
echo "Subject: Test"...