Skip to content

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 y…

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 ques…

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 &#8216…

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 …

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