Category "shell"

How to execute script as bash using "at"?

It was a pain to google solutions for my problem since it is using application "at" :) So the thing is, I am trying to run long runnng operation (I know that I

When using python to run adb shell command, how can i kill a running program in adb shell?

For Android device, if i enter adb shell in iTerm and then run some program to continuously output data(like getevent, logcat), i can kill these programs by CTR

Bash - Remove leading zero for numbers with double digits

I have a variable in bash number which contains values 01, 02, 03, 04, 05, 06, 07, 08, 09, 010, 011, 012. I would like to remove the leading zeros before 010,

Trap and exit big shell script with background processes

I have 2 shell scripts that contain ffmpeg commands (command1.sh and command2.sh). command2.sh has like 500 ffmpeg commands that trigger one after another with

How can I generate a 2D matrix of natural numbers wth zero in ascending order in shell script or another programming language?

I need to generate matrices of natural numbers in ascending order with zero (0), but they are very large ones and it will be hard to write them by hand. What I

How to fix "Powershell needs Windows management system 4.0'

I want to know How i install Powershell in my win 10 pc because it dont came installed in it Please help me. I will be very thankful to you

Are shell scripts sensitive to encoding and line endings?

I am making a NW.js app on Mac, and want to run the app in dev mode by double-clicking on an icon. First step, I'm trying to make my shell script work. Using VS

Parsing list in bash

I have a text file which looks like this: ... unique_trigger = item1 item2 item3 ... itemN u

timeout doesn't work with nvm: nvm no such file or directory

I want to set timeout for each instance of node.js running. but when I run the following commands I got the error timeout: failed to run command ‘nvm&rsqu

bash setting variable getting error command not found [duplicate]

I'm writing one small bash script for my Project but i getting some errors #!/bin/bash count=$(cat Downloads/datei.csv | wc -l); for((i=115;i&

different PDB files add hydrogen same time using reduce program in shell script with modified file name (1axk.pdb <---->1ackH.pdb)

I tried to run this code but its repeated the same file and ignored the other files and I want to stored all the directory files into a variable so that, read t

/usr/bin/cat: -: Bad file descriptor when using pipe()

I am recreating a complete shell. For that I must simulate "|". To do this, I have to use the dup2(), fork() and pipe() functions. here is my code : void do_pip

powershell script to select directory

I would like to create a powershell function or cmdlet that would allow me to quickly navigate to files and function like the example below. Could someone enlig

How to extract only specific strings from each line of a file using awk?

I was wondering if there a generic way to extract a specific string which by design is an eleven characters alphanumeric string using awk approach? for ex- cat

how to solve Parsing expression Lexer error yq

I am using yq for YAML processor. I got this error: Error: Parsing expression: Lexer error: could not match text starting at 1:8 failing at 1:10. unmatched text

How to stop auto-generation of log files by cron?

I have a bot on Marathi language wikipedia. The bot runs from Wikimedi's toolforge server. I have set up a cron job which generates two files: one .err and anot

To replace a immediate text after pattern match in Linux shell using sed

Content of a json file "iso_checksum": "md5:32fdf4fef4ef" I have stored value of new checksum in a variable v = "4dfv45ffdf" I want to replace the value after

Process swap usage with use ID

I've been trying to get a one liner working updated to add the user name for the processes consuming swap on the system but having a hard time getting it to wor

How to properly pass filenames with spaces with $* from xargs to sed via sh?

Disclaimer: this happens on macOS (Big Sur); more info about the context below. I have to write (almost did) a script which will replace images URLs in big text

Git diff command from shell script

I have a script: #!/bin/bash git log -1 | grep -w '^commit' | cut -d ' ' -f2 | git show | grep -w '^index' | cut -d ' ' -f2 > tmp_out while read -r arg do