General :: Append Command Output To File By Giving Command In Terminal?

Jul 3, 2009

I am using openSUSE 10.3.When I install software from tarball then to record time required I send output of date to beg.txt(when installation begins) and end.txt (when installation finishes).How can I append output of date to a file so I don't need two files?

View 4 Replies


ADVERTISEMENT

Programming :: Giving Output Of A Command As The Input To Another

Sep 7, 2010

While making a shell ,there is the following problem Im facing:

I am expecting the user to enter commands in the following format :

I am to separate these and the output of ls -l should be given as input to grep and the output of both to more.

But I am allowed (by our instructor) to use dup/dup2 or any other command(but not pipe or tees).

How to connect the file descriptors after successful execution of each command?

View 5 Replies View Related

Ubuntu :: Log The Command Output's History That Are Previously Printed Messages In The Terminal To A File?

Apr 23, 2011

is it possible to log the command output's history that are previously printed messages in the terminal to a file? that is the first command output when i first opened terminal through the last command.

View 5 Replies View Related

General :: Strange Output Form Terminal - Misunderstood Command

Jul 22, 2011

Tried to make a text file and write something in it (a link) quickly as possible, because I was in a rush. So did this:

[Code]...

Now, looking briefly at the output, can't get what's happened lol! I mean, it's html for crying out loud. Not 'scripting' n all. What do you guys reckon has happened?

View 12 Replies View Related

General :: Way To Stop Command Output To Continue Scrolling Down Terminal

Jan 4, 2011

I moved from a Linux environment from one company to another and one annoying difference came out:When I used to run an application in a terminal (no GUI), the transcript lines were presented one the window - when the window was full then the scrolling of the lines would continue only if one hit the space bar to proceed (of course waiting to user input did not stop the run).

In the new environment the behavior is different - transcript lines keep going on and on so I need to scroll up - and moreover each page-up command is cancelled by the new lines appearing.perhaps this is also reproduce with other Linux commands , say "find" or "ls".

View 4 Replies View Related

General :: Run A Command Per File From The Output Of "find" Command?

Sep 8, 2010

I want to scan a particular directory recursively and run a particular command with each file as input. For this I am using "find /dir/path". I dont want to write any long script containing loop on the output of "find". I want a single command which will allow me to run a command on each file of the "find" command output.

View 3 Replies View Related

General :: How To Print Command Output To A File

Apr 29, 2010

I am creating a script to sync my important documents between two system. I want my script to generate a log file for the last action. can you suggest me a way to achieve this.Question: If I execute the rsync command with -v flag, it will print a lot of messages on the console. Is there any way. So, I can redirect these logs to a file?

View 4 Replies View Related

General :: Redirecting Command Output To File?

Sep 19, 2011

This seems so simple when doing it from command line but I'm not able to accomplish it inside a script. I am trying to put output of following command into a text file:

CMD= mysql -uroot -psecret -e 'SHOW SLAVE STATUS G;'
FIL=~/replication-`date +%F`.txt
MAILTEXT=~/mailtext.txt
touch $FIL
$CMD > $FIL

Where FIL is a variable that contains path of the file to which to output command. I am running this command in a shell script from where I want to email contents of $FIL as attachment using mutt. But I am always getting 0 byte file. Also if I examine in directory the file is of 0 byte length.

View 3 Replies View Related

General :: Command To Overwrite File With Sed Output?

Jan 5, 2010

For example I want a file to be processed by sed, and then overwrite the file with sed's output. I would try this:
Code:
sed '<regex goes here>' myfile > myfile
But it doesn't work as expected, instead it empties the file (I am thinking that as the first byte comes out of sed, it overwrites the whole file and sed has nothing more to do). How can I make this work?

View 14 Replies View Related

General :: Meaning Of File Command Output?

Feb 27, 2010

I used the following command

Code:
file /usr/bin/mawk
Output is

[code]...

View 4 Replies View Related

Programming :: Bash Ambiguous Redirect - Redirect One Command Output Which Will Be Treat As A Content Of File For Another Command?

Mar 9, 2011

I am trying to grep multiple numbers from file, grep does have the -f option for that.

Code: grep -f <`seq 500 520` /etc/passwd I know this could be done with

Code: for i in `seq 500 520`; do grep "$i" /etc/passwd; done But my question is fare more behind this example. It is possible to redirect one command output which will be treat as a content of file for another command ?

View 2 Replies View Related

General :: Gzip Command To Append Some Files

Feb 21, 2011

I have a existing zipped file , I want to use gzip command to append some files to it , I tried man gzip but can't find the key word "append" , can advise how can I do it ?

View 1 Replies View Related

General :: Redirecting Command Output To Input Of Another Command?

Jul 2, 2011

I want to run gsettings list-schemas (which return a list of about 100 names separated by spaces)and somehow direct each name one at a time as the input to this command:gsettings list-recursivelyI've tried it with awk, and standard | piping and also as a string variable strvar=$(gsettings list-schemas) and using the $strvar as the input butam missing something in between I'm sure like for - while or proper syntax of awk etc

View 3 Replies View Related

General :: Use Output Of Previous Command As Parameter To Another Command?

Nov 13, 2010

I want to use the output of a previous command as a parameter to another command. For example: to know where "nice" is stored i typed: which nice output: /usr/bin/nice now the second command i typed is: ls -l /usr/bin/nice Is there a way to have a single command like: ls -l which nice ?

View 4 Replies View Related

General :: Store The Output Of Date And Watch Command To A File

Jun 15, 2011

I am trying to watch a command and try to log it into a file. I tried

watch -t -n 10 "(date '+TIME:%H:%M:%S'
; ps aux | grep "pattern" | wc -l)" >>
logfile

and am expecting a result like

TIME: 10:32:30 12
TIME: 10:32:40 18
TIME: 10:32:50 2

to be stored in logfile. However, when the logfile has unprintable characters in in. How do I get this kind of output from the command li

View 4 Replies View Related

General :: Output To A Text File, The Results Of Compound Command?

Jul 28, 2010

How to output to a text file the compound command:

Code:
find -type f -print0 | xargs -0 grep -l "desired text"
I have not been able to find the answer.

[code]...

View 5 Replies View Related

General :: Iperf Won't Export All Command Output To Text File?

Oct 18, 2010

I've created a script to test network speeds but I've run in to a little problem. The command outputs this:

Code:
Client connecting to 192.168.111.230, UDP port 5001
Sending 1470 byte datagrams

[code]...

View 1 Replies View Related

General :: Identify File System Type From The Output Of Fdisk Command?

Nov 16, 2010

The output of my fdisk command is as follows :-zodiac@gml-admin:~$ sudo fdisk -l[sudo] password for zodiac: Disk /dev/sda: 160.0 GB, 160041885696 bytes255 heads, 63sectors/track, 19457 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe30ce30c

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1958 15727603+ 7 HPFS/NTFS
/dev/sda2 1959 4752 22437838 f W95 Ext'd (LBA)

[code]...

View 2 Replies View Related

General :: Redirect Output Of A Command To Another File Inside Shell Script?

Aug 26, 2010

I am writing a script in which I am using AWK to append to a line in a file and save the file. The command I am using is:

Code:
awk '{s=$0; if ( NR==4 ){s=s ":/usr/java/jdk1.6.0_19/bin" } print s;}' $appName > $appName.new

[code]...

View 4 Replies View Related

General :: Command To Update Terminal As File Is Updated

Mar 13, 2011

I'm looking for a way to have the access log for my nginx install scroll up the terminal as lines are added to the log. I think I need a command like cat access.log | diff but I'm not sure exactly what it should be.

View 1 Replies View Related

General :: Burn Data (file) With Command Line (at Terminal) To DVD Rewrite?

May 17, 2010

Now, I use Fedora Core (version 8) with core linux OS 2.6
I have some file data with size about 2G and I want to burn (write) this file to DVD rewrite.

I know linux OS can install software to burn data to DVD, but I don't have permission to install more software. I only use command line over Terminal (Gnome Terminal).

View 4 Replies View Related

General :: Giving The Command Service Nfs Restart In Fedora14

Jan 5, 2011

When ever i am giving the command service nfs restart in fedora14 iam getting the following:

And when typing the command service portmap restart in fedora 14 i am getting the following:

When i tried this in redhat and centos it was working in my class room but when i am trying it in real time it is not working so what does it mean and how to resolve the issue.

View 2 Replies View Related

Programming :: Show The Output Of Shell Command Into A Textbox, Ex Ps -efc Command?

Oct 20, 2010

I am using gtk to program GUI. How can I show the output of shell command into a textbox, ex ps -efc command ?

View 3 Replies View Related

General :: File Really Is After The Command 'file' Output "data"?

May 3, 2010

I download some movies those are with 'mkv' , but couldn't be played, I tried other players , like mplayer , dragon , xine, even swich OS to windows , didn't work . not all of those files , but some of them. one of them named 'the.other.man', 2GB.I opened a terminal and executed "file the.other.man.mkv "utput is "data", and command 'strings the.other.man.mkv", output like as follow:

T5}.
S!e
I|

[code]...

View 1 Replies View Related

Programming :: Bash: Remote SSH Command Append To AWK?

Sep 29, 2010

I have the following command that works Code: ssh root{at}IPADDRESS 'vim-cmd vmsvc/power.getstate 64 | grep Powered | awk "{ print $2}"' Which outputs the following text:- Powered on I would like to Append some text so the output is:- Ubuntu Server: Powered on Every different variation that I have tried ends up in an unexpected token.

View 1 Replies View Related

Software :: Vim Command To Cut The Current Line And Append To The Clipboard?

Apr 8, 2011

Is there a vim command or sequence of commands that will append the current line into the clipboard? Given the example below:

4
5
3
1
2

Lets say I wanted to cut 3, 4, 5 (in that order) then paste them below 2 so that the numbers are in order?

View 1 Replies View Related

General :: Send The Output Of Send Command To A File?

Jan 20, 2011

in the middle of script, i need to send the output of (send command on line 8) to a file

#!/usr/bin/expect
spawn telnet 172.20.64.133
expect "ENTER USERNAM <"

[cod]....

i treid the below on line 8 :

1- send "show command;

" > logfile.txt : gives an error extra character after the "

2- logsave logfile.txt 'send "show command;

" ': error invalid command

3- i simply tried to send the output of the whole script to file logsave /home/logfile ./script : seems that logsave work under root only

4- ./script > logfile : the problem with this is that the output of echo or (read "enter your id") command will not be displayed on the screen (actually nothing will be displayed, i have to open the log file to see the output). is there any way to save the log of the "send" ? or to save the log of the complete script without hiding the output on the screen?

View 2 Replies View Related

General :: Apache Command And Terminal / Command With Apache Through Web Browser And It Is Not Working?

Aug 18, 2009

I want to run a linux command with apache through web browser and that's is not working. and it's working properly when I execute this command through terminal, where is the problem?

NOTE: apache have the privileges to execute the command

View 7 Replies View Related

Ubuntu :: Is Command Line Invocation Of Gnome-terminal To Run More Than One Command

Feb 17, 2010

how to pass something more than a one-command startup for gnome-terminal. I will give an example of what I'm trying to do here:

Code:

#! /bin/bash
#
#TODO write this for gnome and xterm

[code]....

This same error occurs if the gnome-terminal line is changed to

Code:

gnome-terminal -e mcTerm

Is there any way to pass more than one command on to gnome-terminal? I have tried various single and double quoting senarios and in a final attempt, I abstracted to an exported function all to no avail. Perhaps even though gnome-term is better at many things than xterm, xterm trumps it in this instance.

View 1 Replies View Related

Programming :: Command Line Invocation Of Gnome-terminal To Run More Than One Command?

Feb 16, 2010

I am trying to learn how to pass more than a one-command startup for gnome-terminal.

I will give an example of what I'm trying to do here:

Code:
#! /bin/bash
#
#TODO write this for gnome and xterm
USAGE="
${0##*/} [-x] [-g]
code....

However, running with the -g option to invoke gnome-terminal, I get a "There was an error creating the child process for this terminal" error.

This same error occurs if the gnome-terminal line is changed to

Code:
gnome-terminal -e mcTerm

Is there any way to pass more than one command on to gnome-terminal? I have tried various single and double quoting senarios and in a final attempt, I abstracted to an exported function all to no avail. Perhaps even though gnome-term is better at many things than xterm, xterm trumps it in this instance.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved