10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
I wish to know how to works the carriage return with cat.. As a picture often speaks better than words, my code below :
#te=`cat text.txt` (I tried this, but the same..)
te=$(cat text.txt)
echo $te
My file text.txt below:
BLABLABLABLABLALBLA
BLABLABLABLABLALBLA
... (9 Replies)
Discussion started by: Arnaudh78
9 Replies
2. Shell Programming and Scripting
Hi All,
I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise.
Eg :
Select 'Query 1 output' from dual;
Select 'Query 2 output' from dual;
I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies
3. Shell Programming and Scripting
I want to store the return value of
grep -c string filename
into a variable, say count. How do I do that?
For example if grep -c "string" "filename" shows 0 on executing it in the sh shell then I want to store this 0 in a variable. Is it possible? :D (5 Replies)
Discussion started by: navienavnav
5 Replies
4. Shell Programming and Scripting
Hi,
I need to retrun multiple values
function errorFileCreation
{
echo "Before"
return -1 "Siva";
echo "Aftyer"
}
echo ${?} - This can be used to getting first value.
how can i get second one.
Advance Thanks...
Shiv (3 Replies)
Discussion started by: rsivasan
3 Replies
5. Shell Programming and Scripting
Hi,
I have a script which does something like the below:
execute_some_script.sh $arg1 $arg2 `exec-some-cmd`
if then;
do something
else
do something else
fi
However, during some cases, there is an error saying:
line xxx: [: too many arguments
at the line number which has... (5 Replies)
Discussion started by: laloo
5 Replies
6. Shell Programming and Scripting
Hi
I have 2 working script, now i'd like to get the return value from the first and give it to the 2 script (both script work correctly if I run it separately). so i think the problem is only the first line in the way i pass the variable.
in the final the "print lst", is just to check the... (2 Replies)
Discussion started by: Dedalus
2 Replies
7. Shell Programming and Scripting
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies
8. Shell Programming and Scripting
How do I evaluate the result of a command assigned to a variable??
Example:
var1=`cmd`
rc=$?
rc will be the result of the assignment rather than cmd since it executes after. How do I evaluate the result of the command itself?
Cheers..:confused: (2 Replies)
Discussion started by: browndr
2 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'.
I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies
10. Shell Programming and Scripting
Need some clarification on two topics and I apologize for the long post.
Topic 1). I have a PERL script which sends output to the console. This is executed like a daemon script. I would like to capture the "print" commands of the script to a log file. How can this be done.
Topic 2) Within the... (9 Replies)
Discussion started by: jerardfjay
9 Replies