• Getting repeated lines with awk in Bash 2019-01-15

    I'm trying to know which are the lines that are repeated X times in a text file, and I'm using awk but I see that awk in my command, not work with lines that begin with the same characters or words. That is, does not recognize the full line individua

    Tags: shell, bash, awk, text processing
  • How do I silence the HEAD of a curl request while using the silent flag? 2019-01-12

    When I run the curl command and direct the data to a file, I get back the content of the site as expected. $ curl "" > file.txt $ head file.txt Top of site ... However, this command shows a progress bar, which I do not want: % Tot

    Tags: shell, bash, command line, curl, pipe
  • Infinite loop issue when passing answers 2018-12-31

    I want to only pass the first answer to a function echo "y" | install and let the choice to the user to answer the next questions , but when i do that i get a infinite loop. --------------Solutions------------- When using pipes, the shell change

    Tags: shell, unix, linux, bash
  • How to make 'file' believe that an executable is not stripped? 2018-11-26

    The program file is commonly used among the Linux userbase and I have one question related to this; Every time I strip an executable completely, file reports that the executable is stripped and in some cases, that it is 'stripped to external PDB' - I

    Tags: shell, bash, exe, elf, strip
  • Read output from ttyUSB0 2018-11-24

    After installing one relay board in respberry pi I tested with success some commands to open and close the relays but I found one problem. I do not receive the status of the eight relays or the status of single relay. How can I fix this? The permissi

    Tags: linux, bash, raspberry pi, raspbian
  • Error running bash script in supervisor 2018-11-18

    I have a bash script that makes some work supervising network stuff, it works great when I run it manually, but when I put it in supervisor the ifs and the whiles does not work, just stops before any of those programming sentences, echos, running cat

    Tags: shell, linux, bash, debian, supervisor
  • C++ getenv doesnt update 2018-11-05

    I'm trying to make a program that a bash script runs. I want the bash script to be able to change the state of the c++ program, and the only thing I could find was to use environment variables. Thing is, its seems getenv only gets the value at the ti

    Tags: linux, bash, getenv
  • stdout and stderr redirection in child process 2018-09-12

    If I run a Bash script like this: ./ 2>&1 stderr will be redirected to stdout. If the script calls some tool inside (e.g. ls) or spawns a new process, will these child processes have their stderr also redirected to stdout? --------------So

    Tags: unix, bash, process, stdout, stderr
  • Running Local Script On SSH Server 2018-09-12

    I'm using Linux to log into a server using ssh. Once I'm logged in, I would like to execute a local Python script which uses netcat to run some program on the remote machine (it is therefore required to be logged in to access it). Locally I can type

    Tags: linux, bash, ssh
  • execute shell command with php 2018-09-11

    im trying to execute a bash script with a php/html button to wake my nas. <form action="" method="POST"> <input type="submit" value="Wake NAS" name="zero" /> </form> <?php if (isset($_

    Tags: shell, php, bash
  • linux cron truncate large file 2018-08-16

    I have a large csv file that I need to reduce to the last 1000 lines through a cron job every day. Can anyone suggest how to accomplish this? What I have so far are two commands but do not know how to combine them For deleting lines from the begginin

    Tags: linux, bash, csv, cron
  • How to use a command from awk in the right way 2018-08-14

    I have the next command : awk -v M="$variable" -v B=$"version"-v R="Pass ok" -v K="1" 'BEGIN {FS=","; OFS=","} $1==M {$14=R} {$3=B} {$23=K} {print}' file1.csv > file2.csv and i dont know why i

    Tags: linux, bash, awk
  • how to use getopt/getopts 2018-06-29

    So, I've learned how to pass in arguments in my bash script. The next step for me is to pass in a flag with the argument. For example,-id 12345, -d YES or -d NO, -h localhost. So, I'm looking to execute like so: ./ -id 12345 -d YES -h localho

    Tags: shell, unix, bash, getopts
  • unix command to grep text from server and write it to a file in unix 2018-06-19

    the below i have to do using a script which will be there on unix box server. I wanted to grep text(eg.Some_ID=123456) from log files present in log folder of my server. and want to c create and write that data into another text file which will be al

    Tags: shell, scripting, unix, bash
  • bash script for word count a particualar file in a directory then the result is output in a logfile and the logrotate 2018-06-15

    bash script to word count a particualar file in a directory then the result is output in a logfile and then entry in the log file rotate. this is what I have tried something like: Dir=$1 filename="${Dir#*.}" auditfile="/tmp/claim" clai

    Tags: bash
  • compose images with different names but the same numbers in 2 folders 2018-06-13

    Hello electric friends In Imagemagick I want to compose images from 2 folders with the same number but different name. I have already found "Compose two images in shellscript" but, than I have to rename all files in the second folder first. Whic

    Tags: image, bash
  • script doesn't start on boot with init 2018-05-27

    I have the following script #!/bin/sh # chkconfig: 345 99 01 # description: some startup script ### BEGIN INIT INFO # Provides: weblogic # Required-Start: $local_fs $network $remote_fs # Required-Stop: $local_fs $network $remote_fs # Default-Start: 2

    Tags: shell, linux, bash, init
  • Linux CLI change price (awk or sed?) 2018-03-14

    I have price strings formatted as $25.00 in various html files. I would like to use the Linux command line (BASH, presumably with awk or sed) to increase each price by a certain dollar amount ($3 in this case). In short, I need to find $nn.00 and rep

    Tags: regex, linux, bash, awk, sed
  • How do you source a shell script with in the current process? 2018-03-14 (and all variants) complain about using the '.' and 'source' commands. Is there a built-in way to do this with the run methods or is there a particular executable I can try calling that will mimic bash's source command? --------------Solu

    Tags: bash, dart, dart io
  • Bash quote characteristics 2018-02-13

    So I am curl'ing some data in the form of a dictionary/json and want to make use of a bash variable. If I create a for loop and enclose the dictionary like: for i in {1..5}; do curl blah blah -d '{"key": "value $i"}'; done Then it will

    Tags: bash

Copyright (C), All Rights Reserved.

processed in 2.884 (s). 9 q(s)