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
How to travel in the shell using cat command? (arrow keys are not working)
cat > myfile
I think you are asking for a pager. For that you can use more or less (yes, these are the real names). As an example, you can use cat FILE | less or just less FILE. In there, you can scroll/search/... (exit with q).
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have IPs of all machines are in one text file,how to do scp from one machine to all machines and automate task?
cat ips.txt | xargs -rtn1 sh -c 'scp /source-file "${1}:/target-file"' --
You probably need to adjust the command to your actual needs, which you didn't state.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have this text:
111.11.1.111(*)222.22.2.221(mgn)333.33.3.333(srv)
111.11.1.111(*)333.33.3.333(srv)222.22.2.222(mgn)
222.22.2.223(mgn)111.11.1.111(*)333.33.3.333(srv)
I only want to know the IP's before (mgn), output:
222.22.2.221
222.22.2.222
222.22.2.223
thanks
Through grep,
$ grep -oP '(?:\d{1,3}\.){3}\d{1,3}(?=\(mgn\))' file
222.22.2.221
222.22.2.222
222.22.2.223
Through sed,
$ sed 's/.*\b\(\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\)(mgn).*/\1/g' file
222.22.2.221
222.22.2.222
222.22.2.223
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 9 years ago.
Improve this question
I want to search for a number in string that does not occur between numbers.
For example:
string="10003096,10007051,10003098,10007053,10000952,10002696,10003619,900004608"
If i search for 10003096, then it exists.
But if i search for 1000, then it means it does not exist.
Even if i search for 10000952,10002696, then it means it does not exist.
How can i write the shell script for this?
Please help.
I have tried various options with grep and sed but it does not help.
Pad both your 'needle' and 'haystack' with commas. E.g.
echo ",$string," | grep ",10007053,"
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 9 years ago.
Improve this question
I don't know why it appears in my file when using vim.
Sometimes not in the vim, but in the output of 'git diff', why?
what command can help me check if file under some dir have '^M' problem, and fix all of them?
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 9 years ago.
Improve this question
What command line tools are available for working with XSL in UNIX environments. I would like to use proper tools rather than scripting languages such a bash,sed or awk.
Here is a shell script that modifies a .XSL file
#!/bin/bash
echo "Modified!" > file.XSL
Use with caution!