Skip to content
Advertisement

Tag: csh

awk the previous and current line only if equal to string

I have the following lines in a file I want to get the previous and current line, only if it start with albi. Means, output should look like: I tried the below, but looks I’m missing something: Answer Assuming you do need to test “shush” as in your script, all you were doing wrong is trying to reference an awk

I am unable to type cast string to integer in csh

I want to fetch out ‘-0.5’ from the file example.txt and add 1 to it. Although I am able to fetch out ‘-0.5’. but I am unable to add 1 to it, maybe because -0.5 is considered as a string and not a integer. Code: Obtained Result: Expected Result: How do I type cast -0.5 to integer? Answer csh doesn’t

Search output of p4 command

I am trying to perform an action depending on the output of perforce commands. But it seems that pipping and greping/acking the command doesn’t appear to pickup the output e.g. Further example of what i’m trying to do: Is there anyway to read the output of a perforce command without having to write to a file then read the output?

Calculating a sum of numbers in C shell

I’m trying to calculate a sum numbers positioned on separate lines using C shell. I must do it with specific commands using pipes. There is a number of commands: comand.. | comand.. | (comands…) printing lines in the following form: The result should be 22, since 1 + 2 + 8 + 4 + 7 = 22. I tried …

How to write shell script,to automate file conversion?

I have 30 files(ascii),which I want convert to binary.Linux command line(FORTRAN 77 CODE) that has been compiled Relevant part of the code Then code asks for input and output file names How to automate this?I have tried like this Or But I do not have a clue for next step.Text files are Output files Answer Try this: The variable op_file

Shebang option ‘ #!/bin/csh -f ‘

What does the Shebang option -f do? How do I find, or man, detailed explanations on all Shebang options? Answer There aren’t any “shebang options”. Any options there are options to the binary in the shebang. So that’s a csh option. Specifically (from the man page): -f The shell will start faster, because it will neither search for nor execute

inputrc file cannot be loaded [closed]

Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 10 years ago. Improve this question I just figured out we can create a ~/.inputrc file to define keyboard mappings. But I don’t know how to load it. I tried to source it but

csh scripting for password authorisation of user

I’m trying to write a professional program to accept and process input via a Menu based system. The program should have no command line arguments. it will be writen in csh script called TaskMenu. This shell script will: ask for a password from the user. a. If the password is not correct, the system will exit with an appropriate error

Convert .cshrc to .bashrc [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago. Improve this question I am new to Linux and I am trying to compile some code that needs environment variables set first. The script is in cshrc, but

Advertisement