Suppose that you want to mostly not echo commands inside your script during execution (e.g. to not bog the user down with details that they do not care about) but that there is the occaisional script line that you would like to echo before you execute it.
Is there an elegant way to achieve this?
The ugly way to do this is to have code like
Here, you have to place set +- pairs around each desired echo line which is annoying.
Furthermore, the final set +x line gets printed out--is there any way to suppress that? In dos bat files you can suppress that by putting a '@' char at the start of any line that you do not want echoed when echo is on. Does the bourne shell have an equivalent?
The function that I wrote below works for simple commands, but it fails (in both cygwin and linux) for really complex ones (e.g. a long Java program invocation with lots of arguments and a big classpath).
Hi
I have written a bash script to capture the output of jmap.
The command i execute is jmap -heap <pid>
This gives details of memory usage of the process with <pid>.
Now jmap not only gives this info but also prints couple more lines, which i am not interested in. Here are the lines that I... (3 Replies)
I am new to the c shell script, can you let me know why the set rr= is not working.
C shell script
#! /bin/csh
Set tt= 12345_UMR_BH452_3_2.txt
set rr='echo $tt | cut –d”_” -f1'
syntax error (4 Replies)
Hi all,
I am executing a Oracle SQL statement in a shell script and spooling the output of the query into a File with spool command.
I want to ensure that only output of the query appears in file excluding the SQL statement but even set echo off command is not working.
Please help (7 Replies)
I got a program named as "fastq_to_fasta".
I got a long list of file all named as AB1 and AB2.
My input file is :
071022_L1_AB1.fq
012121_L1_AB1.fq
021213_L1_AB1.fq
012153_L1_AB1.fq
071022_L1_AB2.fq
012121_L1_AB2.fq
021213_L1_AB2.fq
012153_L1_AB2.fq
.
.
.
.
.
.
My desired... (10 Replies)
Hi,
I have a shell script with code
. perf.env
cd $QRY_DIR
for SHELL_FILE in sql1
do
export SNAME=$SHELL_FILE
${SCRIPT_DIR}/perf_qry.sh ${SPOOL_DIR} ${DB_ENVNAME} ${NAME} &
RC=$(expr ${RC:-0} + $? )
sleep 60
if
then
echo sysdate>test1
echo query1.txt>>test1
grep -i... (6 Replies)
Hi,
I have a shell script with code
. perf.env
cd $QRY_DIR
for SHELL_FILE in sql1
do
export SNAME=$SHELL_FILE
${SCRIPT_DIR}/perf_qry.sh ${SPOOL_DIR} ${DB_ENVNAME} ${NAME} &
RC=$(expr ${RC:-0} + $? )
sleep 60
if
then
echo sysdate>test1
echo query1.txt>>test1
grep -i... (0 Replies)
I have a directory. To this directory, for Group bits combination, it is showing as 's'. Which I found out, it means "Set User ID on execution mode". Within this directory I am not able to create subfolder.
Does it mean, only the Owner of this directory will be able to create subdirectories &... (5 Replies)
Major Newbie here folks. I'm trying to set a variable to my Home directory and then echo it to the screen.
Any and all help is greatly appreciated.
Thanks
Anna (3 Replies)
I'm looking at my bash man page and I'm expecting to find some option that I can use to make it echo every command that it executes. The description of --verbose was pretty terse!
Is --verbose supposed to make it echo every command it executes?
My bash script script (named ws2) contains a... (1 Reply)
I want group to run one of my unix script as me . I when the script is run it should have my permission's not the group .
I tried this :
1.Have a file called y.ksh
cat y.ksh
echo $LOGNAME >ak_test
2.Output file has this permission
-rwx------ ak_test
3.Then I chnaged... (7 Replies)