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


ADVERTISEMENT

General :: Does The Output Of The Previous Command Get Stored In Any Variable

Mar 26, 2011

For example, when using bash you can use

Code:

to execute the previous command or

Code:

!<number> to execute the Nth command(use history to see the list). Or you can use

Code:

cd !-2:1

to cd into the value in the first field that was executed 2 commands ago Anyhow, say I run a command and the output is a path. Any way to cd and then some variable where OUTPUT of the previous command was stored? A variable that always stores the OUTPUT of the last command.

View 8 Replies View Related

General :: Redirecting STDOUT Of Previous Command To STDIN Of Next Command

Nov 20, 2009

i'm trying to redirect the output of a command to the input of the next command. not sure if i'm going about this the right way. an easy method would be just to store the output of the previous command in a file and redirect input to read that file, but i'm curious to see if this can be done without writing to any files.

View 9 Replies View Related

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 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 :: Pass Response As Command Parameter?

Mar 10, 2010

I have a backup schedule running a full backup everyday. I'm using webmin to manage these backup now. The problem is when the dump command sends a prompt asking if we want to rewrite the tape, Webmin does not display this prompt and we end up having to terminate the backup -> erase the tape(which takes a long time) and then run the backup again.I was wondering if there is a technique that could be used to pass "Yes" as a parameter to the dump command, much like in windows? or if there is a more efficient way of getting this done.

View 2 Replies View Related

General :: Set Parameter At The Boot Command Line?

Aug 20, 2010

I am following an instruction on the Internet to set up a timer=1. "You can force use of the timer interrupt by using the timer=1 module arameter (or oprofile.timer=1 on the boot command line" When I type "modprobe oprofile timer=1" at the command line, I got a warning message saying that "Deprecated config file /etc/modprobe.conf" So i want to try other way by setting it at the boot command line.

View 2 Replies View Related

General :: Retrieving Previous Command For All Users?

Mar 17, 2011

Allow me to submit that i did a mistake of not saving the work which i done in the past few months. i have used history command to see the previous commands. But trouble is that since i had worked a lot on gnome-terminal, only last 1000 commands are shown. Is it possible to see list of all the previous commands for all users. Also, sorry if this sounds absurd, but is it possible to save the details of a session onto a single file ? I not sure but when i had worked on vector Linux, i had used some command to save sessions at the terminal. Is there any analogous command in Ubuntu 10.04 also ?

View 2 Replies View Related

General :: Navigate To Previous Directory In Windows Command Prompt

Mar 24, 2011

Possible Duplicate: Navigate to previous directory in windows command prompt

Is there an equivalent of Linux's cd - (change to previous directory) in Windows?

View 3 Replies View Related

General :: Move To Previous System Date Using Command Line?

Sep 21, 2010

I want to know the command, so that i can move back two days i.e. all the changes i made during the two day is rolled back .

View 5 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 :: 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

Programming :: O_SYNC Parameter In Open Command?

Jul 9, 2010

I have a small board that has a static ram board attached to it. I have two different programs that each write to a byte of memory in the static ram board. I get a file descriptor to the device memory with the following code:

int phymemfd;
phymemfd=open("dev/mem, O_RDWR | O_SYNC);

This opens the physical memory for both reading and writing. Next I get a pointer to the beginning of my ram board.

volatile unsigned char *novram;
novram = (unsigned char *) mmap(0, getpagesize() * 31,
PROT_READ|PROT_WRITE, MAP_SHARED, phymemfd, 0x11AA0000);

I do this same code in two processes that are both running and this works fine. Now, if I take out the O_SYNC parameter, one of the programs gets into some sort of weird state.My understanding of the O_SYNC parameter is that it cause the process accessing the memory location to block, not allow another process to run, until the first process has finished writing to it.I can see that if my program doesn't block, I wouldn't really know what was in the memory location, but would I can't see how it would cause any other type of system problem.

View 1 Replies View Related

General :: "shutdown" Command Allow A Parameter To Determine The Pause Between Sending SIGTERM And SIGKILL?

Jan 1, 2011

The man page seems to indicate no. There is /etc/rc.d/init.d/halt on Fedora. It has a hard coded pause in it, but there's got to be a better way than to change that script.

View 2 Replies View Related

Programming :: Find And Replace Using Passing A Parameter To Said Command?

Apr 9, 2010

I am trying following script can I do this or is there a way to do find and replace the replacing word is dynamic input by user

echo -n "Enter name:"
read RP_USER
sed 's/text1/$RP_USER/' /home/user/file1 > /home/user/file2

View 5 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

Server :: Shell Scripting Command Line / Getting Error While Passing Parameter?

May 6, 2011

I am very new to shell scripting.How does one pass a command-line parameter to a shell script?for the below program
#/bin/bash
mount -t cifs -o user=ramkannan,password=Linux123@ //10.200.1.125/ramkannan /MT
cd /MT/test
date=`/bin/date "+\%Y-\%m-\%d-\%H-\%M-\%S"`
mysqldump -uroot -pram2@ employeedb > $date.sql
gzip $date.sql

I want to pass parameter for everything,i tried in google and did but iam getting error while passing parameter to all

#/bin/bash
mount -t cifs -o user=$1,password=$2 //10.200.1.125/ramkannan /MT
cd /MT/test
date=`/bin/date "+\%Y-\%m-\%d-\%H-\%M-\%S"`
mysqldump -uroot -pram2@ employeedb > $date.sql
gzip $date.sql

i was getting error while passing parameter to all.

View 2 Replies View Related

Software :: SCP Error: Unrecognized Configuration Parameter Permitlocalcommand When Run ANY Type Of Scp Command

Jan 31, 2011

This started happening about 2-3 weeks ago when i noticed our backups weren't running anymore. whenever i try to run ANY type of scp command I get the following error: warning: Unrecognized configuration parameter permitlocalcommand ssh: FATAL: Illegal -o parameter "PermitLocalCommand no" lost connection

I checked the /etc/ssh/ssh_config file and there was a command PermitLocalCommand commented out, but for testing I even totally removed that line and then in scp forced the use of that file via scp -F /etc/ssh/ssh_config ......

and I still get the same error. This command is nowhere is any of my ssh config files so im at a loss here on how im supposed to fix this!! I even checked my home directory for maybe a ssh config file that might be overridding the system config but nothing.

View 1 Replies View Related

General :: Redirect Output From Dd Command?

Apr 7, 2010

How to redirect output from dd command to /dev/null ?

View 2 Replies View Related

General :: Copy Command Output In Vim?

Jul 25, 2010

For example, if I type ':pwd' to get the current working directory, I can select the text in gvim but I can't figure out how to copy it to the clipboard. If I try the same in console vim, I can't even select it with the mouse. I would like this to work with all vim commands, such as set guifont to copy the guifont=Consolas:h10:cANSI output.

View 4 Replies View Related

General :: Format The Output Of The Ps Command?

Aug 27, 2010

i am running ps xo "pid,command" but I can't find my process in the results. I know that the process is running because I run ps ax | grep command-name

View 4 Replies View Related

General :: Bash Command Output?

Feb 12, 2011

What does the following Shell program do ??: () { :| : &} ; :Warning: My computer got hung when i tried to execute this.Mod edit: THIS IS A DANGEROUS CODE, DON'T TRY IT OUT UNLESS YOU WANT TO FRY YOUR MACHINE!

View 2 Replies View Related

General :: Add The Hostname To Output Of Other Command?

Apr 28, 2010

i have a variable called hostname which contains hostname of my machine. How would i add the hostname to output of other command . For eg. if a output of command is . command : xm list

Quote:

abc 123 334
bcd 223 333
ddd 333 333

How would i add hostname column to it. My output should look like

Quote:

abc 123 334 hostname
bcd 223 333 hostname
ddd 333 333 hostname

View 1 Replies View Related

General :: Modify The Output Of Df Command?

Mar 20, 2010

this is the output of df command on my system

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda8 18073924 4911628 12244184 29% /
udev 642140 308 641832 1% /dev

[code]....

View 14 Replies View Related

General :: Output Format For LS -LTR Command

Feb 5, 2010

I have a script that is in Unix. I wanted to know is there any difference between output of ls command in unix and linux

In Unix
Code:
ls -ltr | awk '{print $9}'
In linux output is something similar to

Code:
drwxrwxrwx 2 vinay vinay 4096 2010-02-04 20:31 test
According to above output nothing will be displayed for

Code:
ls -ltr | awk '{print $9}'
ls -ltr | awk '{print $8}' will give test as ouptut in Linux.

I wanted to check the output format for ls -ltr, Anyone using Unix systems may paste a sample output of the command ls -ltr..

View 2 Replies View Related

General :: No Output From Top Command Run By Crontab?

May 17, 2011

I write a little script that run top command and clear the output leaving only cpu ram and swap values. If i run the script manually everityng works fine but when i schedule the cript to run every 5 minutes from /etc/crontab all run fine but the output of the top command doesnt appear in the log :

This is the cript :

#!/bin/sh
echo "#############################" >> /var/log/performance.log
echo "" >> /var/log/performance.log
/bin/date >> /var/log/performance.log

[code]...

View 6 Replies View Related

General :: Not Able To Understand The Output Of W Command

Aug 9, 2011

I have taken putty session of a server from two separate machines namely HOST1(3 sessions) and HOST2(1 Session) . However w command says there are 5 users

Code:
# w
09:29:36 up 34 days, 15:48, 5 users, load average: 0.62, 4.33, 8.16
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/17 HOST1 09:18 4:26 0.01s 0.01s -bash
root pts/18 HOST1 09:27 1:21 0.00s 0.00s -bash
root pts/21 HOST2 09:29 0.00s 0.00s 0.00s w
root pts/20 HOST1 09:29 1:39 0.00s 0.00s -bash

View 3 Replies View Related

General :: Output From 'mount' Command

Jul 6, 2010

How to find out of a filesystem is in readonly mode?

What will the output be from the 'mount' command if a filesystem is read-only?

View 2 Replies View Related

General :: Analyze The Output Of Sar Command?

Mar 17, 2011

I need a tool to analyse the output of sar command. just like sarg which analyses the log files for http , squid etc . I need a similar tool for sar output analysis.

View 3 Replies View Related

General :: Exec Command With Grep Output?

Feb 15, 2011

I have a requirement to find the files having its name as ack_reply. However, there are many other files in the same directory as these resides. Now I have to remove these files from the folder and retain others after 7 days. So I tried to write the below script with grep command.

find $directory -type f -mtime +7 | grep ack_reply

how can I pass this output to -exec command.

If I am not using grep command my script would be as

find $directory -type f -mtime +7 -exec remove.sh {}\;;

How can I use -exec with grep and find.

View 4 Replies View Related







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