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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

AWS credentials are not available after number of child processes more than 40

I have an AWS EC2 host with 96 vCPUs I execute following script which spans async child processes up to a certain limit (passed as a script param). Each async child process calls AWS CLI and exits #!/...
Alexander Pavlov's user avatar
1 vote
2 answers
30 views

confusing grep pattern with BRE

greptest.txt: cat sheep dog money money cat ca+ caa Since + is not included in BRE(POSIX Basic Regular Expression), command grep 'ca+' greptest.txt treats it as a plain text character, and the ...
Jack Ma's user avatar
  • 181
0 votes
1 answer
36 views

azureDevops: create new policy for branch via powerShell

"I have a project on Azure DevOps with two repositories: repoTest1 and repoTest2. On repoTest2, on the main branch, I would like to create and apply this pull request policy with the following ...
account italianu's user avatar
0 votes
1 answer
42 views

Filtering out empty files in azure-storage-azcopy sync

I am using azure-storage-azcopy sync to sync between source and destination. This already works ok so far but often I receive empty files on source folder and that also gets copied to destination. How ...
jarvo69's user avatar
  • 8,065
-1 votes
0 answers
19 views

Shell Script for passing multiple audio sources as arguments to a script that uses ffmpeg for recording video/audio? [duplicate]

I have the following Shell/Bash Script, that records video with audio in my Linux: #!/bin/bash # Command to record audio from one microphone and video from one webcam ffmpeg_cmd="ffmpeg -f ...
Raul Chiarella's user avatar
-1 votes
1 answer
19 views

I need to download the csv file from URL in unix korn shell using curl command

There is one URL which will download the csv file, I have to use it in Unix shell script using 'curl' command. Because the already existing script was using the same script, Since the URL has been ...
ImSahil's user avatar
  • 65
0 votes
0 answers
53 views

How can I use c language to interact with shell

May I ask if there is any method to interact with shell using C language? My main goal is to execute commands using SSH, for example, ssh [email protected] ls. However, the target computer requires a ...
dustChou's user avatar
-2 votes
0 answers
20 views

Binary file execution error while installating Cortex XDR in amazon linux

Using below user data script in aws ec2 instance i tried to install cortex xdr agent. During this process when i look into the system log i had found an error ./setup.sh: line 731: /opt/traps/bin/...
karthik's user avatar
-1 votes
0 answers
29 views

How do I replicate the following syntax in my MAC terminal [duplicate]

I am working with Devops on AWS and there comes a part when the user is in Downloads folder. Next to the Downloads, it is followed by git:(argo-all-namespaces) x cd write_your_first_terraform_project ...
Elvis's user avatar
  • 3
1 vote
2 answers
22 views

is there any way to compile DataStage 11.7 jobs in Unix/Linux using shell?

I have tried using dsjob --help if there are any compiling commands but I cannot seem to find any command which can compile. is it possible to compile using uvsh because there isnt much material i can ...
dumb person's user avatar
1 vote
0 answers
30 views

How to prevent a folder and its content from being deleted?

I have created a symlink to make an application load it files from a shared folder Its working correctly, when i uninstall the application it delete all files in the folder, how could i stop the files ...
Yune's user avatar
  • 11
-6 votes
0 answers
42 views

Regex para validação de string [closed]

Guys, I need a regex that validates the value of a string, like the acceptable value is the range between 1024 and 262144, smaller than 1024 must be barred and greater than 262144 as well: =1024 or &...
user21448216's user avatar
0 votes
0 answers
22 views

Text Editor recommendations for django shell (python manage.py shell) [closed]

When performing debugging or adding data to my database from csv files I rely on the django shell (python manage.py shell). I used this during development on a windows PC and although, I hated using ...
Johannes Schwenzer's user avatar
-2 votes
4 answers
86 views

Make sed to replace capture group with corresponding environment variable

Assuming we have source_file.json of the following content: { "someVar": "__SOME_ENV_VAR__", "anotherVar": "__ANOTHER_ENV_VAR__", "yetAnotherVar&...
S. Rullio's user avatar
0 votes
1 answer
27 views

sed to rebuild a manifest from a 2nd file

I'd like to replace a file content for some lines (not all of them) matching another file content: File1 is a manifest with this format (thousands of lines): ... f 755 myself mygroup /opt/app/...
Kerkael Belarpaillon's user avatar
1 vote
3 answers
46 views

Search 32 character long directories only with find

Let say I have a directory with a lot of subdirectories: 04762b39018e3cf4b1a2c6a304919b75 06e0caf156de30dd962cf6b9300aba66 1f1d0cb1b810336299cda5426d0f12f5 2fe7a428eb303da6846800fa20ab7ed4 ...
Darwick's user avatar
  • 369
-1 votes
0 answers
49 views

Get exit code of last command in a shell script

Using $? I'm trying to get the exit code of the last command I entered, but something seems to be interfering. I'm wondering if this is because the $? variable doesn't play nice with scripts or if ...
RubikOwl's user avatar
0 votes
1 answer
45 views

How to make the shebang use the value of an environment variable

I have a file named kong like this: #!/usr/bin/env /usr/local/openresty/bin/resty setmetatable(_G, nil) pcall(require, "luarocks.loader") package.path = "./?.lua;./?/init.lua;" ....
Yongqi Z's user avatar
  • 611
0 votes
0 answers
26 views

Error try to run scala but it didn`t work

Welcome to Scala version 2.10.5 (OpenJDK 64-Bit Server VM, Java 11.0.17). Type in expressions to have them evaluated. Type :help for more information. scala> [init] error: error while loading ...
Andi0905's user avatar
0 votes
0 answers
20 views

Redirect output and error to the same file using ProcessExecutor

I am using ProcessExecutor org.zeroturnaround.exec.ProcessExecutor, for executing a shell script in Java. The requirement is to to color code any error logs from the execution and write the output ...
a_good_human's user avatar
0 votes
0 answers
26 views

How to open and iterate over webpages in a .sh file

I have a rasberry pi running rasbian that i want to convert to a smart clock to open 3 webpages and iterate over them on startup I have the following code # Open Outlook website and Time.is in ...
Stefan Groenewald's user avatar
0 votes
0 answers
27 views

How to execute ".exe" from R shell(cmd) as admin?

I need to execute an ".exe" File from R through the shell as administrator. I have the admin rights for certain operations such as executing the particular ".exe" file. When I use ...
Philipp Wegmueller's user avatar
0 votes
2 answers
59 views

How to copy multiple files from many directories to corresponding directories with different names?

I have an apps folder. I need to copy all the .env.test files in each directory inside the apps folder to the corresponding .env file. So for example if I have the following 2 directories insided the ...
kerolloz's user avatar
  • 340
0 votes
1 answer
56 views

How to loop over items from AWS CLI output?

aws ecs list-tasks --cluster dev-ec2s this shows the list like this below, in this case three lines, but it can change. "taskArns": [ "arn:aws:ecs:ap-northeast-1:678100222222:task/...
whitebear's user avatar
  • 11.5k
1 vote
2 answers
77 views

How to start a Frida server from cmd?

I'm trying to start Frida from Windows cmd but its hanging and not proceeding to the second & command: >adb -s 127.0.0.1:16480 shell "/mnt/shared/frida-server &" & frida -U -n ...
Luma's user avatar
  • 11
-1 votes
0 answers
15 views

Capture the real-time percentage values displayed by flashcp [closed]

When I use flashcp -v $IMG_FULL_PATH /dev/$HOST_MTD, can I capture the real-time percentage values displayed by flashcp? I want to store the percentage value in a variable in real-time for use ...
林姿均's user avatar
1 vote
4 answers
67 views

Print all the usernames of users as well as their home directories

I'm trying to print all the usernames of users as well as their home directories. All I have found online is how to change the passwords etc. Could someone please guide me to figure this out? echo $...
Nick-Fonseca79's user avatar
0 votes
3 answers
50 views

Search using a partial string but save the full string as a variable

I want to read a text file which has the following data: “set current_day=24” “set current_month=12” “set current_year=2023” The numbers can change so I have set 3 variables which will always be ...
Rubberducky's user avatar
0 votes
0 answers
61 views

What does this "if" statement do? (Meaning of "$# -ne 1"?) [closed]

I'm working on a homework assignment and part of it has the following code: if [[ $# -ne 1 ]]; then echo -e "$Usage: $0 URL\n" exit 1; fi Part of the assignment is to explain what ...
nkloney's user avatar
  • 13
-1 votes
0 answers
23 views

When calling a file in a command, I get error "File" does not exist, exiting now. However, the file shows up if I type -ls or cat "File"

I am working on an intro to bioinformatics assignment. I want to run hisat2 to align 2 files, the command is $ hisat2 -p 8 --dta -q -x SRR8846455_1.fastq -1 SRR8846456_1.fastq -S samples.sam but when ...
Boone Jones's user avatar
1 vote
1 answer
49 views

Use godownloader.sh but couldn't find the binary file in /usr/local/bin

I use goreleaser to publish my release and godownloader to create the shell script for installation. I run the command on my Mac: sudo /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/...
ZZZ's user avatar
  • 29
0 votes
1 answer
41 views

How to disable selected visualstate FlyoutItem in .NET MAUI Shell

The MAUI Shell displays a blue vertical line to the left of a MenuItem after you click on it. It also changes the background color to be slightly darker. I'd like to disable that visual indication. ...
dalchri's user avatar
  • 99
-1 votes
0 answers
22 views

Git command is not returning any value in makefile [duplicate]

I have a simple makefile that should print git log, which looks as below. SHELL=/bin/bash get_log: echo $(git log) However when I run make get_log, nothing is returned, although if I run git ...
Avnish Singh Jakhar's user avatar
-1 votes
0 answers
17 views

Why are the Commands have been not found? [duplicate]

i wrote a script in linux terminal the problem is that the command in line 17 and 19 havent been found and im asking someone if someone could help me to rewrite those lines enter image description ...
luan nguyen's user avatar
0 votes
0 answers
28 views

Using find in a bash script and having issues with shell exansion that I can't figure out [closed]

I've got 2 syslog servers. I am trying to write a function to randomly pick one of the servers and cat the log files. However, this directory is managed by logrotate.d and as a result, we end up with ...
Josh Williamson's user avatar
-1 votes
0 answers
27 views

How to search for a file using locate in the current level of directory through regex? [closed]

I'm using mlocate to search for a file, however whenever I start a search, it always search the name of the file for all levels in the directory I'm in, when I only needed to look in the first level, ...
robertinho's user avatar
1 vote
2 answers
51 views

Scrapy response returns an empty array

I'm crawling this page with scrapy and I'm trying to extract all the rows of the main table. The following XPath expression should give me the wanted result: //div[@id='TableWithRules']//tbody/tr ...
Maurizio Brini's user avatar
0 votes
0 answers
31 views

How to make a catalogue to select from a list of items in cli? [closed]

I am trying to make a catalogue somewhat similar to what sanity cli shows when sanity init is executed. img I want to make this using only shell scripting. I was trying to find a way but couldn't.
Asish Kumar's user avatar
2 votes
2 answers
59 views

Glob pattern to include files with extension except for in a specific directory

Given the following directory structure: . ├── Examples/ │ └── A.hs ├── Mooc/ │ └── B.hs ├── .stack-work/ │ └── C.hs └── D.hs What is a Bash Glob pattern to include all .hs files except for ...
Abhijit Sarkar's user avatar
0 votes
0 answers
32 views

how to find file path where the function resides in solaris [duplicate]

confPlatform above is the function we are using for configuring the certain conf file in the setup. ksh# type confPlatform confPlatform is a function how to find the file where it's defined?
Mohan's user avatar
  • 919
0 votes
0 answers
41 views

How to check if the folder is a mounted folder?

I ussually use this shell script to check if the folder is a symlink or not : if [ -L path ] but in my case , the folder can be in 3 types : normal folder, symlink folder or mounted from my network (...
andio's user avatar
  • 1,652
0 votes
1 answer
65 views

Do I need to add every version of Python to PATH?

I've been getting this error when using pip to install: "WARNING: The script foo is installed in '/Users/bar/Library/Python/3.9/bin' which is not on PATH." Do I need to remember to add to ...
JobHunter69's user avatar
  • 1,773
0 votes
1 answer
23 views

Running a command within a launched shell within an apptainer instance

I'm working towards setting up a script for batch submission to an HPC system which uses software in an apptainer image. Here's what I have in mind: apptainer run container.sif runjob.sh runjob.sh ---...
Arland's user avatar
  • 45
-2 votes
0 answers
23 views

mv: Cannot move permission denied [closed]

I'm not able to move file with in the sub directory while renaming, I'm doing this from another user. I have already all the permission on it. User file: [user_2]$ pwd /ddisk/opt/app/app1/files/...
Shirchabayshan's user avatar
1 vote
3 answers
67 views

Combine multiple timestamped lines into a single line

I have thousands on many lines in a text file. Some consist of 2 lines, some have 1 line, as seen below: 1 00:01:18,479 --> 00:01:20,514 Dr. Oppenheimer. 2 00:01:24,052 --> 00:01:25,653 As we ...
July Elizabeth's user avatar
-2 votes
3 answers
72 views

Let's make a list of ways to convert text to titlecase in Linux [closed]

There are many ways on the Internet to convert text to lowercase and uppercase, but few ways to convert to titlecase. Let's make a list of ways to convert text to titlecase in Linux. I found these ...
0x7633's user avatar
  • 19
0 votes
2 answers
32 views

Why is my shell script splitting my JSON object in the middle of a string?

I am having problems parsing a JSON file using jq from a .sh script. When the object contains a space, shell splits it into two. Can i escape the space somehow? From command line: echo $(jq '.' ../ext/...
PlanetaryAlignment's user avatar
0 votes
1 answer
36 views

Ansible - Concatenate list of items for command module without surrounding quotes

I'm trying to concatentate an Ansible list into a space seperate string without surrounding quotes within a shell or command module call. The command I'm trying to use requires a space separated list ...
another_d's user avatar
-2 votes
1 answer
63 views

Read user input and update a file using that input using bash [closed]

I have a need to write a bash script which takes username and password from command line and then encrypts the password and update a file with the username and encrypted password.Say there is existing ...
Rishabh Jain's user avatar
0 votes
0 answers
19 views

Running a command with Ampersand kills the process after next command

I am trying to run a process in background. I ran the following command: sudo gitlab-runner run latex >> gitlab-runner1.log 2>&1 & This gives me the pid of the process that is ...
Prabhjot Singh Rai's user avatar

1
2 3 4 5
1846