I'm trying to write a simple script program (C shell). I have a problem redirecting input into a variable. Say I have a variable called J, and there is file called result which contains just some number, say 5. Which command should I use to assign J value 5 from the file result. I tried the... (2 Replies)
how make assign the output of the command (for example: grep "file" "string" ) in a variable ($name)?
i thing how put the result of the command (grep , cut, find ecc) in a variable..
IT's Possible ?? (1 Reply)
how do you redirect stdout into a variable. whenever I try I get an ambiguous redirect error :( I am trying to validate some user input and failing miserably.
cal $MONTH $YEAR | grep -c "$DAY"
if the above is 1 then it is valid if 0 then not valid. I have been trying to redirect the output... (2 Replies)
for the below
grep -i $1 "${logdir}"* | grep -i adding | grep -iv equation | tail -1 | cut -d ':' -f 1
the result of the grep i want to redirect into some variable, i tried to do
veri=grep -i $1 "${logdir}"* | grep -i adding | grep -iv equation | tail -1 | cut -d ':' -f 1
but it is... (2 Replies)
hello
just i saw a really strange for cat
i have file (file1) contains line /home/rajiv/proj1/*.txt
now applied a commonds
DDPATH="$(cat file1)"
echo $DDPATH
it shows all the txt files in that folder like /home/rajiv/proj1/read1.txt /home/rajiv/proj1/read2.txt... (7 Replies)
Hi!
Been working on a script and I've been having a problem. I've finally narrowed it down to this variable I'm setting:
servername=$(awk -v FS=\/ '{ print $7 } blah.txt | sed 's\/./-/g' | awk -v FS=\- '{print $1}')"
This will essentially pare down a line like this:
... (7 Replies)
Hi, I read in this forum that for "https://www.unix.com/shell-programming-scripting/156008-integer-expression-expected-regular-expression.html
thanks! (7 Replies)
I've tried numerous commands, but I am not sure how to use sed in a loop. This is what I have:
VARZ contains CARD_FILE_LIST and it also contains CARD_FILE_LIST2
so
echo "$VARZ"
CARD_FILE_LIST
CARD_FILE_LIST2
I have a file with 60 lines in /tmp/testfile it and I want those lines deleted... (3 Replies)
Hello,
I am trying to print out the first string matching query with grep and I need your help.
My scenario:
Database
John F
4433 Street No 88 CA
Elisabeth Taylor
7733 Street No 26 ON
Jack Nicholson
0133 Green Park No 34 AR
John F 2
9399 Southpark No 02D UT
test.sh... (6 Replies)
I have a little code block (executing on AIX 7.1) that I cannot understand why the NOTFREE=0 does not appear to be assigned even though it goes through that block. This causes a unary operator issue.
#!/bin/bash
PLATFORM="AIX"
NEEDSPC=3000
set -x
if ; then
lsvg | grep -v rootvg | while... (6 Replies)