Skip to content
Advertisement

Tag: unix

[: missing `]’ error in Unix | shell Script [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 3 years ago. Improve this question

AWK with commands [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 3 years ago. Improve this question I’m learning in Linux and my senior give me a task

Renaming JSON files based on their contents

I have loads of geographical json files with date_geohash.json name format and I have to convert them to date_latitude-longotude.json format. For example I need to convert 2017-03-28_u13hhyn.json to 2017-03-28_N52.76-E1.62.json.   I’m trying to write a bash script to rename these json files using ‘rename’ and ‘jq’ (json query) utilities. Using jq I can extract latitude and longitude from the json files.

how ignore warnings to go in stderr

I’m run a command and I want to just get errors in ‍‍‍‍stderr file not warnings I want to just get errors in error.txt,not warnings. I want this output: Answer You can filter the stderr if you want: Explanation: Redirect the stderr stream to command Copies lines containing ERROR to only-errors.txt file If you want to keep a copy of

How to split a single XML file into multiple based on tags

I have an XML file that have tags. I want to split files like this. Below is the code tried . But it is generating every single line into a new file I want to split this file based on ORDER tags alone as mentioned below Answer With any awk in any shell on every UNIX box: it’s obviously fragile

How to run a command on file in directory recursively creating a new file in each directory being visited (Bash)?

I have a directory with a few sub-directories. I’d like to create a copy of each results.csv file in the same directory named results_cleaned.csv where certain lines will be removed. Each sub-directory is known to contain only a single file, results.csv. Running this on a single directory works: However, running the same command on a root, produces just a single

Advertisement