Questions tagged [shell]

30389 questions
1

votes
0

answer
93

Views

Set maximum time for download with wget recursive

I am crawling multiple webpages with wget. However with some of then it would keep downloading files forever, so I run it from a bash script which kills it 10 minutes after start. However wget does link conversion at last (--convert-links) and if I kill it the files would have the original links an...
NeDark
1

votes
2

answer
1.2k

Views

How to run a TestNG.xml through a Shell Script in Jenkins?

First Step: I created a BAT File with below mentioned commands and tried running it > It did successfully run the TestNG Suite with all the tests I had configured. Next Step: was to set up the Jenkins I was trying to run the bat file with the Add build setup > execute Windows bat command > cd /d %...
S K
1

votes
0

answer
119

Views

Add new column in file using sed

I am trying to add a new column in a file and using below command got from another Stack overflow post: sed 's/$col/$col$FSEP$value/' $file > ${file%.*}'_m.txt' col=1 is column number, value=20171231 is the and FSEP=| is the field seperator. current data: '01 '|'name '|'address '|' phone number...
Explorer
1

votes
0

answer
31

Views

How can file writes with NodeJS on Docker be inconsistent?

A while back I've created some feed fetching & processing scripts with NodeJS for an application I'm working on. I've been running this script on my local machine (OSX) manually for a while and momentarily I'm working on having a job do this. I figured I'd go with a Docker droplet ($5/mo) on Digital...
nicoes
1

votes
0

answer
101

Views

Introduction/Text on android permissions / shell

Here is my problem: Using the Team Win recovery mode, I tried two things. One works and I do not understand why the other one does not: From the terminal, using vi, i made the file /system/bin/tteesst, which is: #!/system/bin/sh echo Hi I did a chmod 755. I copied the su-file from /supersu to /syste...
Hinxlay
0

votes
0

answer
10

Views

Bash with few commands, whitelisting few built-in commands

Trying to open a bash shell with limited command capability. Tried command line options like -r restriction but doesn't give intended result. Also tried shopt & unset commands. bash --noprofile --noediting --verbose --version --init-file test.sh unset ls shopt -u -o history Start a bash shell with...
Kunal G
1

votes
1

answer
45

Views

Unable to do a correct match

Hey guys I am working on a project in which, I need to store device names in the file and then I am trying to find that name using cat file | grep device and if that name exists i am trying to print the yes else no.I did this via the following code but I am unable to achieve the expected result, pl...
Dixon
1

votes
0

answer
147

Views

How to avoid zombie process from crond ( crond -l 9 )

My system based on Linux ( 3.12.14 ), I could see Zombie process [ sh ] creates for very frequently. I have found that (crond -l 9) which was parent process of zombie. I confirmed that, always crond -l 9 was parent process. As per crontab (crontab -l), lot of scripts are running based on configura...
mselvara1982
1

votes
1

answer
355

Views

zsh export path works when directly type in terminal, but not work when put in /.zshrc

I am frustrated on getting this to work... I am using zsh and from a tutorial it needs me to put these three lines in .zshrc in order to get android sdk to work export ANDROID_HOME='$HOME/Library/Android-SDK' export PATH='$HOME/Library/Android-SDK/tools:$PATH' export PATH='$HOME/Library/Android-SDK/...
Billy Chen
1

votes
2

answer
66

Views

awk commands in file gives error when executed in loop

file_data.txt 73|8|42.320000|1559260800000|1|9667|0.00|42.320000||1485613678440| 153|8|35.680000|1559260800000|1|10899|0.00|35.680000||1482480306523| 2503|8|93.390000|1559260800000|1|6106|0.00|93.390000||1484304241803| 2672|8|49.990000|1559260800000|1|7754|0.00|49.990000||1482064270543| AWK_COMMANDS...
Ashish
1

votes
0

answer
80

Views

How to store backslash+dollar-sign (“/$”) in R?

I'm trying to generate a script using R. I want the script to include the following command: GPU0=$(nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits | awk 'NR==1{print$1/100}') If i want to do this in the terminal, I would execute the following command: echo 'GPU0=\$(nvidia-smi -...
clee165
1

votes
1

answer
34

Views

Started JBOSS Service via Shell Script, but hanging

I managed to start JBOSS service through a shell script running locally inside the server. if [ $? -eq 0 ]; then { sh /jboss-6.1.0.Final/bin/run.sh -c server1 -g app1 -u x.x.x.x -b x.x.x.x -Djboss.messaging.ServerPeerID=1 & }; fi My problem is I am able to start the service and found the applicatio...
Dinesh
1

votes
1

answer
303

Views

Error on check-env.sh installing Apache Kylin on Hortonworks

I'm trying to install Apache Kylin on a Hortonworks Sandbox following the instructions provided on Apache Kylin install. I set up on my .bashrc export KYLIN_HOME='/root/kylin' (inside this folder there are the Kylin Binaries ). In step 3 it say to run bin/check-env.sh to check for a enviroment issu...
Nadia Bastidas
1

votes
0

answer
97

Views

How to send a specific picture to whatsapp in my android application

Can someone please help me with this adb shell code needed to share a specific picture (screenshot I took) to what's app? Here's the code I tried: am start -a android.intent.action.SEND -c android.intent.category.DEFAULT -t image/* -e stream storage/emulated/0/Pictures/Screenshots/screen.png When ex...
user185361
1

votes
1

answer
58

Views

How to read/search specific content in a webpage using shell scripting

I'm a beginner in shell scripting. I'm trying to write a script in which a part of it involves reading the value from a webpage. In this case, The shell script tries to fetch the IMDB rating of a movie by going to the movie's IMDB page. Can someone suggest me how i can achieve this & also what are...
Ravi Kiran
1

votes
0

answer
89

Views

Python Idle Starts With “No Subprocess” so running script freeze

I had no problems selecting 'run' from a script opened with idle before Windows Update made updates. For some reason, now when I select 'run', the new live idle window freezes up and the script window freezes up. This did not occur before updates but from what I can see, none of the updates would e...
chitondihk
1

votes
1

answer
54

Views

Unexpected Shell Script errors [duplicate]

This question already has an answer here: Why would a correct shell script give a wrapped/truncated/corrupted error message? [duplicate] 1 answer I am having errors where I am putting in code that should be working fine into a shell file and when I run it, it fails to run correctly. The error I am...
Danny Franklin
1

votes
0

answer
36

Views

how to rename a bunch of files pre-pending incrementing index at the front?

suppose i have a list of files. file1.mp3 song.mp3 random.mp3 light.mp3 I want to rename all of them by pre-pending an index at the front. 1-file1.mp3 2-song.mp3 3-random.mp3 4-light.mp3 how can i achieve this with a batch script in windows? Thanks!
kofhearts
1

votes
1

answer
164

Views

Bash missing all shell commands

I'm trying to convert by boyfriend's old computer into a development environment because mine broke and I can't afford a new one, but it seems to be missing damn near every shell command I'm used to. It doesn't have ls even! The help command gives me this: bash-4.4$ help GNU bash, version 4.4.12(1)...
Andrea McKenzie
1

votes
1

answer
58

Views

ManyToManyField is not displayed in the Python shell

I am learning how to work with mysql database,using Django. I've created models in myapp.models. I've added ManyToManyField to my model. I've applied the changes made to these models, using makemigrations and migrate. All processes have been going OK. However, this ManyToManyField is not displayed i...
aspiring
1

votes
0

answer
121

Views

port exclude pattern from inotifywait to fswatch

So I have this regex exclude pattern which works excellent with inotifywait on Linux: .*\.\w+\.\w{6} Now I want to port it to fswatch on macos and use with -e or -Ee flag. What have I tried so far without any luck: -e '.*\.\w+\.\w{6}' -Ee '.*\.[[:alpha:]]+\.[[:alpha:]]{6}' -e '.*\..+\..{6}' # not ex...
valignatev
1

votes
0

answer
49

Views

Count lines of code by user.email in a git repository

In a git repository, how do I count the lines of code written by an author based on his/her user.email not his/her user.name
toandv
1

votes
0

answer
83

Views

Emacs shell: won't show output unless putting new line character

I recently noticed that my Emacs shell won't show stuff in stdout unless I put a new line character at the end. For example, if I write a hw.c program, my emacs will only show 'hello world' if I write printf('hello world\n'); in it. Omitting the \n will make the Emacs shell output disappear. I am wo...
Yayuchen
1

votes
0

answer
436

Views

MongoDb import a json file into already existing collection as an update to single entry

I have a mongo collection that looks like this: { 'identifier' : 'BM10003', 'count' : '0', 'data' :{ 'label1':'value1', 'label2':'value2', } } In the above collection identifier field is unique and I use that to add more data to this entry. Now i want to import a json file that gets added to this...
Yatish
1

votes
1

answer
58

Views

Run process and suspend it while Internet is down, continue when up, on loop

I have a command that is overly sensitive to timeouts, and a shitty Internet connection that gives me multi-second periods of no connection that are just frequent enough to cause that command to fail. I would like a Bash script of the form: tubeify -t 100ms -- /usr/bin/somecommand with its arguments...
Sai
1

votes
1

answer
253

Views

start WebLogic from Jenkins

I want to stop and start WebLogic from Jenkins. If I start by shell script in Jenkins: ./startWebLogic.sh the process is not finished, but WebLogic is started. If I start by shell script with nohup in Jenkins: . ./setWLSEnv.sh nohup ./startWebLogic.sh > /dev/null & the process is finished, but WebL...
Vadim
1

votes
1

answer
66

Views

sh script to replace text in multiple files

I am trying to replace every occurrence in a .prm file of the string '/net/origin/devdata1/slin' with '/tools/common/test/HATS' in over a hundred files using sed. I think I am having trouble with the proper syntax for a for loop that loops through different files in a directory(/home/AutoTest), and...
dhboots
1

votes
0

answer
92

Views

How to change ruby or php version in google cloud shell console

Is it possible to change the ruby or php version used in google cloud shell console? Specifically, I'd like like to keep the console using the ruby version used by my app engine, after I had to specifically set it to Ruby 2.42 (or whatever) in the yaml file. Or more generally, can I customize the c...
P. Hepp
1

votes
1

answer
56

Views

printing in wrong place when using initscr() from curses

I have the following code. initscr(); while ((ch = getch()) != '#') { system('ls'); } endwin(); The problem is that the result is not normally printed. This is how it give me the result: project project.c shell.c test test1.c test2.c Project shell Signal Labs test1 test2 text....
Ahmad Alibrahim
1

votes
1

answer
37

Views

How can I pass a list of image names from a csv file to the find command?

So I have a csv file with a list of image names formatted as such: FPC-84WB.jpg Arctic-Blue.jpg Azuria.jpg Azuria-Reflective.jpg BLACK-REFLECTIVE.jpg Bronze.jpg Champagne.jpg Copper.jpg Light-Green.jpg Orange.jpg Pacific-Blue.jpg .... last-image.jpg I want to use find /var/www/html/ -name [name of i...
Nate Swanson
1

votes
1

answer
80

Views

Multiuser screen session from a shell script

I've looked up every tutorial i've found but none of them really answer my question. I'm looking for a way to make a script which will : Create a screen Launch a 'nodejs file.js' command in it Distach Make the screen accessible to every user from the group 'devs' For now here is the shell script I w...
Rackover
1

votes
2

answer
38

Views
1

votes
0

answer
142

Views

How to check whether device is unauthorised or not in adb batch script

I'm writing a batch script file for my device to perform simple adb actions. Now I need to check whether my device is detected or not in pc using command adb devices. But if the device is detected in adb devices it can be of two status, 1st if its unauthorized, it will show as xxxxxxxx...
njnjnj
1

votes
1

answer
193

Views

How to correctly use the linear-gradient while styling GNOME shell?

I'm working on a gnome-shell extension and I can't get the linear-gradient to work properly (or at all, in fact). The GTK documentation or this post state that we should be able to use something like this: label { background-image: linear-gradient(to top right, blue 20%, #f0f 80%); /*OR*/ background...
ChG
1

votes
0

answer
69

Views

Not able to run /etc/profile.d/chruby.sh while deploying using Capistrano in Rails

I have been trying to deploy my rails application on an EC2 instance. The steps which i have taken already are Locally: I installed all the gems by writing in Gemfile and bundle install: group :development do gem 'capistrano' gem 'capistrano3-puma' gem 'capistrano-rails', require: false gem 'capistr...
alchemist95
1

votes
2

answer
34

Views

Adding arguments into array by loop

I want to create script which will create directories. User has to pick how many directories he wants to create, and then has to name those directories. I already have something like this, but I stuck and don't know how to add arguments into array by loop.. Could you tell me how it should be? #!/bi...
Marcin A
1

votes
0

answer
60

Views

Why does assigning from a nonexistent command-line argument succeed? [duplicate]

This question already has an answer here: Check existence of input argument in a Bash shell script 9 answers Validating parameters to a Bash script 9 answers How can I make bash treat undefined variables as errors? 2 answers I have a BASH script to add two numbers where I want to pass two numbers...
bholanath
1

votes
0

answer
31

Views

impossible capture sql error with shell script

I have 2 shell scripts. One with data connection like that (script1.sh): #!/usr/bin/ksh query='$1' whenever sqlerror exit 3 connect $user/[email protected] ${query} EOF echo $? if [ 0 -ne '$?' ]; then exit 1 fi and other is a shell script bigger where I execute sql commands like these: #!/usr/bin/ksh set -x...
user8957934
1

votes
1

answer
50

Views

Bash script failing but part running

Can anyone see anything wrong with the following? I have been looking over and over and can't see the issue, but its failing to create the SQL dump and no tar is being created. The variables would have their details obviously. I have checked these are all correct. #!/bin/bash SITE='' PATH='' SERVE...
ccdavies
1

votes
1

answer
101

Views

Shell-Script to join all CSV files in directory with two key-columns

I'm struggling for a while now. I have a directory with more than 5 CSV files. The idea is to join them all with a script (maybe with a loop?). Example with only two files: File1 1 ; 1.1 ; xyz 1 ; 1.2 ; abc 2 ; 2.1 ; gfa File2 1 ; 1.1 ; dft 1 ; 1.2 ; asd 2 ; 2.1 ;...
Teo

View additional questions