I'm a tester, I want to write a function with bash to collect log which the command I run. the log contains the "shell prompt--->
root@intel_5500_server:, and the last whole command in the shell ----> such as "cd /root/;ls |grep .sh"
to be clear it should be sommething like
something like below I want a function like collect_log
then I can get the log like
1)I don't how to get "root@intel_5500_server:~#"
2)I don't know how to get "cd /root/;ls |grep .sh"
can some one help me, Is it possible to make it as a function
Last edited by yanglei_fage; 12-19-2012 at 11:35 AM..
Not sure where the problem is. I can run the script without any issue using the following command.
. /opt/app/scripts/cdc_migration.sh
But it fails with the below error when I try it this way
/opt/app/scripts/cdc_migration.sh
/opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)
ls xx > yy.log
echo $? can get the return value of "ls xx"
but if I use
ls xx |tee -a yy.log
I can't get the return value of "ls xx", and I get the return value of the whole cmd "ls xx |tee -a yy.log", it is always "0"
my question is how could I get the return value of "ls xx"... (1 Reply)
Folks -
Firstly, I do apologize that my first post here is a question. I am quite familiar with UNIX since our application is running on it. We are trying to automate a few things on our end and I am challenged with a task in hand that requires UNIX scripting. I am totally a newbie in UNIX... (4 Replies)
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)
I want to know if there is any documentation or any type of information that can give a list of all of the return codes that can be seen in the /var/cron/log. I have seen a couple in my log file. Example: rc=1 and rc=64. (2 Replies)
I have an execution in my shell script when run return a xxx.log file
how wil i be able to get the name of the file and read it then test the string written in the file by the programs...
Anyone can help me please...
Am new to shell programming......
Lutchumaya (1 Reply)
Hallo
I want write a sh script but I have some troubles!
How can I write the Return value to a variable? I need an egrep command with the option -c, how many times it give the pattern. This return value shold be written in a variable.
Could you help me? (1 Reply)