General :: Pipe Output Of Shell Command Into A New Buffer In Vim?
Jun 29, 2010
How can I pipe the output of a shell command into a new buffer in Vim? The following obviously wouldn't work, but you can see what I'm getting at:
:!echo % | :newtab
View 2 Replies
ADVERTISEMENT
Jul 21, 2011
I need to pipe the output of date command, to form a command like this:
mycommand -f 20110721
where 20110721 is current YearMonthDay.
View 1 Replies
View Related
Sep 30, 2010
Is there a way to process the output of a locate command on the spot within bash. The output is 3 lines, ex:
Code:
[root@server confluence]# locate .timestamp
/opt/confluence/confluence-persistent/index/.timestamp
[code]....
View 3 Replies
View Related
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
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
May 25, 2011
In a terminal in OSX I can pipe output to pbcopy and then go into a web browser and paste it. I tried this in Linux with xcopy but when I switch to the browser it just overwrites the clipboard with with whatever was in it the last time the browser was used. What works like pbcopy in Linux?
View 1 Replies
View Related
Jul 12, 2011
I write LaTeX in Emacs and then run a shell script to process the LaTeX code. I used to run a subshell buffer with M-x shell and then execute the script from within there, but this results in a lot of switching between buffers, which seems unnecessary. Then, I found out about executing shell commands with M-! cmd RET, as described here:[URL]The problem with this is that the output from the script splits my screen. It's a nuisance, and I would like to run the script without any output. I've tried appending > /dev/null to the command, but it doesn't work.For example, when from within Emacs I enter M-! followed by
Code:
sh make.sh > /dev/null
it splits my screen so that one portion displays output from the make.sh script. I want it to run silently, and leave my Emacs buffers alone
View 3 Replies
View Related
Jan 18, 2011
This is an extremely weird issue that I can't find any help with on Google. It is minor but extremely annoying.
When I type in a linux command in the terminal, (e.g. "ls -la"), and then press enter, the cursor goes to the next line and just sits there, as if its processing some long command.
If I press enter again, I see the ls output as well as my prompt twice. It's like the terminal window isn't auto-scrolling, but I've also seen this happen when there wasnt even enough text in the console screen to warrant a scrollbar. Has anyone seen this before and know what I need to do? I hope what I'm asking about makes sense.
View 3 Replies
View Related
Jan 26, 2011
I have a command that outputs n lines of text, and I want to place each line into an array element, but I can't seem to get the syntax correct
So my command is this:
cat $configfile | sed -n '/cluster:'$clustername'/,/cluster/ p' | awk /host/
Which produces many lines depending on the value of $clustername. I'd like to get each line as elements of an array.
View 5 Replies
View Related
Feb 8, 2010
After running the following command, I get:
[root@yukiko /]# find / -iname .bashrc
/home/clamav/.bashrc
/home/vpopmail/.bashrc
/etc/skel/.bashrc
/root/.bashrc
But I would like to have a command that prints a specific line by supplying the command with the line number, for example:
[root@yukiko /]# find / -iname .bashrc | getline(2)
/home/vpopmail/.bashrc
Is there such a command on CentOS?
View 3 Replies
View Related
Apr 5, 2011
For instance, suppose I want to pipe the output of ps -A to a gtkdialog table.
View 1 Replies
View Related
May 3, 2011
I want to pipe the output of ls in a folder to a file (lets call it test.txt) but when i do so, but when i do ls > test.txt in test.txt there is also test.txt (logical
View 4 Replies
View Related
Aug 19, 2009
I have a bug where WoW under wine is crashing my computer, and I want to get the data from the console, so I want to put it in a file, but I don't know how! None of the piping tutorials online helped at all.
View 2 Replies
View Related
Jan 13, 2010
I want to kill a specific program with the kill -9 pid in a hole command. How do I pipe and kill the output from this command? pidof transmission |
View 9 Replies
View Related
Mar 24, 2011
I want to have the output of a program go to 2 different files but not going to standard out. Is there a way to do this in bash? I know that in Z shell its really easy. omething like: Code: echo "test" >> file1 >> file2 Would work. But in Bash it doesn't seem that easy. I know that tee will send the output to 2 files but it also sends it to STDOUT.Something like:Code: echo "test" | tee -a file1 file2 Would put the word "test" in file1, file2, and STDOUT. Is there a way to just send the output to file1 and file2?
View 2 Replies
View Related
Aug 22, 2010
Anyone know how to send output to buffer via putty? Currently I am using vim with windows copy menu, very slow and tedious.
I download xclip but i got the following error:
Quote:cat ../mnt/fs1/tmp/rcentre01.log|xclip
Error: Can't open display: (null)
View 3 Replies
View Related
Mar 20, 2010
I'm trying to use the output from gdialog's input box in another command with no success. code...
View 3 Replies
View Related
Jul 22, 2010
I'm following the "The Perfect Server - Fedora12 x86_64 [ISPConfig 3]" instructions and I am encountering an error when trying to build the rpm for courier-imap (from page 4 of the HOWTO).
The command I run is:
Code:
rpmbuild -ta courier-imap-4.6.0.tar.bz2
The error is below:
Code:
INFO: LOGIN, user=confmdtest, ip=[127.0.0.1], port=[0], protocol=SMAP1
INFO: LOGOUT, user=confmdtest, ip=[127.0.0.1], headers=0, body=0, rcvd=26, sent=610, time=0
sort: fflush failed: standard output: Broken pipe
[code]....
RPM build errors: Bad exit status from /var/tmp/rpm-tmp.85697 (%build)
View 3 Replies
View Related
Feb 4, 2010
I have following script.
Code:
#!/bin/bash
export VAR="shell"
echo " $VAR in parent "
bash
echo "shell in child "
If i execute this script, the output is just
Code:
shell in parent
Why can't I see the output shell in child ?
View 2 Replies
View Related
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
View Related
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
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
Jul 15, 2010
I often have issues starting my window manager--xfce. My computer misbehaves in one of 3 ways, one of which is to fail to open X, but generate several screens of info. I want to paste that info to this site, but since I'm in the shell, not the terminal (please correct my vocabulary if it's wrong here), I don't know how to copy and paste the output, since right-clicking doesn't give me a menu. Even if I could copy I'm not sure the information would be accessible in X. Are there any other options?
View 13 Replies
View Related
Feb 8, 2010
On command line I have no problem storing a variable e.g
Code:
:~/bin$ process=`ps -ef | awk ' $8 == "idesk" { print $2 }'`
:~/bin$ echo $process
26736
:~/bin$
When I try to incorporate this into a shell script I get a blank.
Code:
:~/bin$ cat process_idesk
#!/bin/bash
process=`ps -ef | awk ' $8 == "idesk" { print $2 }'`
[code]....
The process_idesk script has been chmoded to be executable by the user. I'm sure there must be a silly omission on my behalf.
View 3 Replies
View Related
Nov 19, 2009
Before I begin I would like to say that while I am not a Linix newbie, I am not a guru or even a regular user so don't assume I have anything more than general Linux knowledge. I am carrying out research involving virtualization and Single Sign On technologies and I need to display a Xen based virtual machine to the desktop before the user is logged in. This is for a demonstration system and I am trying to find a solution that involves the least amount of system modification possible.I found a PAM module that allows for the invocation of arbitrary shell scripts which would allow me to start and display the virtual machine in question, but when trying to run the virt viewer (or any process with graphical output) I am informed that the display cannot be found. Explicitly setting the DISPLAY env to :0 before running the command has no effect.
This is where my Linux knowledge runs out. I know that there has to be some way to connect to the X session being used by the greeter, I just don't know what that method involves. The shell script is running with root privileges, so it can access whatever "X credentials" are stored locally.
I will be thankful for any assistance this forum might be able to provide, but please do not suggest alternatives to displaying a VM for my SSO needs, and please avoid any solution that involves having to write my own custom greeter. If there is absolutely no way to accomplish what I am trying to do without greeter modifications definitely tell me, but I am a security researcher, not a Linux developer so I am looking for the easiest solution to implement, even if that solution is a gross hack.
View 1 Replies
View Related
Feb 24, 2011
Regarding this task, I am able to print colored output in my putty sessions using tput or ASCI codes but whenever I tried to send that output through mail command to my outlook maillox, It always goes without colored. I need to produce those coloured output of the scripts as it is in mail.
View 1 Replies
View Related
Feb 7, 2011
I want to write expdp output in a text file using a shell script
If i write like below:
It will write whatever is there in log file to text file
But, sometimes export fails with out start taking export (without generating log file) because of job already exists error. such times, we dont know about that error until we check manually... so i wrote like below:
But still it is not writing anything in to text file using above stmt...
View 1 Replies
View Related
May 9, 2010
I'm looking for an mp3 file in the firefox cache folder.I was thinking I could run the command 'find -size +2M' and pipe that output into the 'file' command to tell me which is an mp3, something like thisfind -size +2M | fileBut this doesn't work, what am I doing wrong?This is output Usage: file [-bcikLhnNrsvz0] [-e test] [-f namefile] [-F separator] [-m magicfiles] file...file -C -m magicfilesTry `file --help' for more information.
View 4 Replies
View Related
Aug 11, 2010
I understand that $! is the PID of a command. For example:
Code: #!/bin/bash
myprogram &
echo "PID of myprogram is $!"
I'd like to send the output of "myprogram" to both console and to a log file using the "tee" command but I also want to store the PID of "myprogam". Something like this:
Code: #!/bin/bash
myprogram | tee ./logfile &
echo "PID of myprogram is $!"
The problem is that $! is now the PID of "tee" rather than the PID of "myprogram".
View 3 Replies
View Related
Mar 2, 2011
I've written a simple server in linux used fork to create a FIFO pipe.The server create two FIFO pipe.One for server read data from client and write data to client.Then another pipe for client read data from server and write data to server.When the server read data from a client used server-pipe and then write data to client.But ,if the client no read open the pipe,the server side write will be crashed because of a broken-pipe SIGPIPE. How to check whether the read side is opened?Or,how to catch the SIGPIPE,and then my server will still execute on,not crashed!!
View 5 Replies
View Related