All Questions
8
questions
0
votes
1
answer
640
views
How to pass a variable to a sed command in a csh script?
Unix & Sed noob here!
I have a requirement where I need to put a suffix ",waive" in case a line in a report containing a matching string.The matching string is part of another file "...
1
vote
2
answers
125
views
how to create a csh script that can identify the correct USB disk where I have saved my virtual machines
I'm running Freebsd 13R and as shell I'm using csh. I would like to create a script,that looks the presence of the word "r1w1e2" or "NM13N4CZ" or "3e4d31334e34435a" when ...
4
votes
3
answers
172
views
Introducing a line break into a file having different columns on the basis of text in the value column
I would like to introduce a line break into a file having different columns on the basis of the value in the first column.
For example:
Input file:
1aa6 HETATM 4MO A 803
1aa6 HETATM SF4 A 800
1ao0 ...
0
votes
1
answer
1k
views
Can't create an alias in tcsh shell when trying to sed some string with .*
I'm trying to create this alias in tcsh shell:
alias repeat 'zgrep -i __NCELAB_SNAPSHO \!* | grep -v make | grep -v Flags | sed 's#CODE_COVERAGE_TYPES.*TEST_DONE=1##g''
And getting an error:
alias:...
11
votes
4
answers
25k
views
Convert value from scientific notation to decimal in shell?
How to convert value from scientific notation to decimal in shell? (preferred C shell)
Also I'd want to convert it from e-12 to e-9 and then shell
42.53e-12 to 0.04253. I have to do this for a list.
1
vote
3
answers
4k
views
How to replace one line with two lines using sed in csh on BSD?
I have a very simple text file here with the following contents
line1
line2
line3
line4
I want to modify the contents via sed(or some other app) so it becomes
line1
line2
#this line was added by ...
4
votes
1
answer
3k
views
How to use ! in the sed command?
Apologize if you feel this question very basic. Anyways, I am typing
sed '/[iI]t/ a\\
Found it!' data but it says the error event not found.
I tried escaping that ! with backslash \! but it doesn'...
4
votes
4
answers
20k
views
sed command to replace a blank line with two lines of content
How do I replace the first blank line with two lines of content? I did see a question on replacing multiple blank lines with a single blank line in vim sed but don't quite see how to adapt that. So, ...