vi editor, grep or sed

Thread Tools Search this Thread
Special Forums UNIX and Linux Applications vi editor, grep or sed
# 1  
Old 10-25-2007
vi editor, grep or sed

I'm currently building a system to perfom a check on some operations on a unix system, i'm very new to unix and i need help.
i know 'uname' displays the name of the OS been used, but how do u send the content of uname into a directory or file ?
# 2  
Old 10-26-2007
There are many ways to do this depending on the scripting language you are using; or if you are simply using a command line.

If you are simply using a command line, you can redirect to a file like this:

 command > output.txt

If you want to append to the same file, you can use:

 command >> output.txt

You can do this in a script so many, many ways; depending on your skill and tools; PERL, PHP, SED, AWK, etc etc.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3

Hi , I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows. # diff mir_lex.c.modified mir_lex.c.orig 3209c3209 < if(yy_current_buffer -> yy_is_our_buffer == 0) { --- >... (5 Replies)
Discussion started by: breezevinay
5 Replies

2. UNIX for Dummies Questions & Answers

Help with sed/grep

Hello Everyone! I'm kind of new to parsing and would like extract a partial part of my nmap scan output so I can convert it to csv/excel: My current file has two types of lines like this: Nmap scan report for dns1 ( Nmap scan report for dns2 ( Nmap scan report for ... (3 Replies)
Discussion started by: SarahS
3 Replies

3. Shell Programming and Scripting

Insert charactera in 1st position of specific lines using vi editor or sed command

Dear all, i am having text file like below surya rama ranga laxman rajesh reddy i want add string (OK) before a text from line 3 to 5 the result will be surya rama OK ranga OK laxman OK rajesh reddy (1 Reply)
Discussion started by: suryanarayana
1 Replies

4. UNIX for Dummies Questions & Answers

Help with sed editor

I am a newbie to Unix and Linux, sed "32,45s///g" file : sed "s/\(\)-\(\)/\1\2/g" file How do we describe these commands in English ? Please help. (2 Replies)
Discussion started by: krthknaidu
2 Replies

5. Solaris

Epic Editor was not able to obtain a license for your use. Feature Epic Editor :Licen

Epic Editor was not able to obtain a license for your use. Feature Epic Editor :License server is down (1 Reply)
Discussion started by: durgaprasadr13
1 Replies

6. Shell Programming and Scripting

set EDITOR=vi -> default editor not setting for cron tab

Hi All, I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by set EDITOR=vi it does not open a vi editor , rather it do as below..... ///////////////////////////////////////////////////// $ set... (6 Replies)
Discussion started by: aarora_98
6 Replies

7. UNIX for Dummies Questions & Answers

Pasting text in VI editor from a different editor

Hi, I knw its a silly question, but am a newbie to 'vi' editor. I'm forced to use this, hence kindly help me with this question. How can i paste a chunk 'copied from' a different editor(gedit) in 'vi editor'? As i see, p & P options does work only within 'vi'. (10 Replies)
Discussion started by: harishmitty
10 Replies

8. Shell Programming and Scripting

how to dereference the variable in sed editor

Hi I am trying to do the substitution using the 'sed' editor. In the line below I am trying to substitute all instances of XXX by the value of the variable PX sed 's/XXX/${PX}/g' ${TEMPLETE} > ${TEMPLETE}.${PX} The problem is that 'sed' editor takes ${PX} literary (without retrieving the... (2 Replies)
Discussion started by: aoussenko
2 Replies

9. UNIX for Dummies Questions & Answers

Grep or Sed

Hi All, I have created a bourne script that basically wants to split a file up in to different parts. I have this working if the file has all the information on different lines but if it doesn't then it doesn't work. i.e. If this is the file hello 12345 good bye 6789 I could grep all the... (5 Replies)
Discussion started by: jazz8146
5 Replies

10. UNIX for Dummies Questions & Answers

SED and it used with | and grep

I am really lost I don't know what this line does. Please help I'm very lost. Thanks in advance. cat CPROGRAMS.c |sed 's// /g'|tr ' ' '\012' |grep '' |sed 's/^*/ /' |grep '($'|sort -u|tr -d "("` (4 Replies)
Discussion started by: Lem2003
4 Replies
Login or Register to Ask a Question