---------- Post updated at 10:36 AM ---------- Previous update was at 10:26 AM ----------
[/COLOR]And I just realized one really brain-dead simple solution: Let the server do the parsing. I do this over ssh sometimes.
This also prevents people from inserting clever things in the 'commands' file that end up running locally.
[rest of the post]
Your method is a little naive in a couple ways. For one thing, it's a useless use of backticks:
Also, your xargs solution could be done with one fewer process like
Basically, whenever you do 'cat foo' you can replace that with a shell redirection in nearly all circumstances. This is quite a bit more efficient.
As for why the command isn't doing what you expect, the shell doesn't substitue strings more than once -- it won't check inside things it substitutes for things like quoted strings or variables. So embedding strings and variables in a string won't work unless you explicitly tell the shell to re-evaluate it, with eval. Note that eval supports all valid syntax so someone could inject variables or local commands where you didn't expect them by escaping $ and so forth.
[COLOR="#738fbf"]
Last edited by Corona688; 02-10-2010 at 12:48 PM..
Hi,
I am new to unix. Is their a way to pass the output of the line below to a variable var1.
ls -1t | head -1.
I am trying something like var1=ls -1t | head -1, but I get error.
Situation is: I get file everyday through FTP in my unix box. I have to write a script that picks up first... (1 Reply)
I fairly new to SED. I have tried many different variations of this line of code and even breaking it down into its components and running them separately.
They work individually without variables but when I place the $todbname variable it will either inserts the text "connect to $todbname"... (3 Replies)
hi,
dataParse(){
line="$@"
name="cat /etc/passwd | grep "$line": | cut -f6 -d':'"
eval $name > sam.txt 2>&1
sudo -u $line sed -n 's/data-1/&/p' $name/test.xml >> sam1.txt
}
Here i getting the homedir of the accounts and is set in
name variable.which returns "/home/raju" which i... (3 Replies)
Hi,
I have a situation where I have to specify a different value to an awk command, I beleive i have the gist of this done, however I am not able to get this correct. Here is what I have so far
echo $id
065859555
This value occurs in a "pipe" delimited file in postition 8. Hence I would... (1 Reply)
Hi guys,
I wanted to pass a variable to the sed command which tells which line to be deleted.
a=2;
echo $a;
sed '$ad' c.out
it is throwing an error.
sed: 0602-403 "$a"d is not a recognized function.
I even tried "$a" and \$a.. but it is of no use.
Can you please correct me... (6 Replies)
Hello All,
I am trying to embed variable in sed command to fetch a portion of record between two pattern.
This command is not working ...any suggestion on this how to place the variable in sed command to find a portion .
I am using Sun OS (Solaris).
Thanks
JM (1 Reply)
I have a script that kicks off several processes in the background and stored their pids in a variable as follows:
PID_DUMP_TRAN=$PID_DUMP_TRAN" "$!
so I then have a list of pids
If I echo $PID_DUMP_TRAN I get back a list of pids e.g. 8210 8211 8212
However I then want to kill all these... (5 Replies)
Hi all,
I have a file looks like
AAAA 111
BBBB 222
CCCC 333
need to pass variable value like var1=AAAA and var2=111
to another command for three times with next values.
stuck over here
cat file | while read line
do
export var1=`awk '{print $1}'`
echo $var1
export var2=`cat file... (3 Replies)
Hi,
As the process of log cleanup, Im using the below command
find $DIR -mtime +3 -type f -exec gzip {} \;
The problem is I want to pass +3 as variable in my unix shell.
I have defined ZPDATE=+3 in my properties file and calling this property file in my script.
If i try the... (6 Replies)
Discussion started by: Deena1984
6 Replies
LEARN ABOUT DEBIAN
grisbi
GRISBI(1) General Commands Manual GRISBI(1)NAME
grisbi - Personal finance tracking program based on GTK
SYNOPSIS
grisbi [options] file...
DESCRIPTION
This manual page documents briefly the grisbi command. This manual page was written for the Debian GNU/Linux distribution because the
original program does not have a manual page.
grisbi is a personal finance tracking program with a lot of features:
* bank, cash and passive accounts
* several accounts at the same time
* several currencies, including euro
* arbitrary currency for every operation
* money interchange fees
* switch to euro account per account
* describe operations with relatives, categories, sub-categories, notes
* transfers between accounts, even for accounts of different currencies
* reconciled balances
* automatic and manual expiries
* automatic recall of last operation for every relatives
* nice and easy user interface
* online user manual
* QIF import/export
OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is
included below.
-?, --help
Show summary of options.
--version
Show version of program.
AUTHOR
This manual page was written by Benjamin Drieu <benj@debian.org>, for the Debian GNU/Linux system (but may be used by others).
August 22, 2002 GRISBI(1)