Suppress "Where are you?" Message


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Suppress "Where are you?" Message
# 1  
Old 07-07-2009
Suppress "Where are you?" Message

Code:
biff n
pdir=`pwd`

# check for null parameter
if [ $# -lt 1 ]; then
  echo current directory $pdir
  ls -latr
  echo
else
  p1=$1
  #check for directory entry only
  if [ -d $p1 ]; then
    pdir=$p1
    echo current directory $pdir
    cd $pdir
    ls -latr
    echo
  #check for directory entry and file
  elif [ -f $p1 ]; then
    pdir=`dirname $p1`
    echo current directory $pdir
    cd $pdir

    for f in $*
    do
      pfile=`basename $f`
      ls -altr $pfile
    done
  else
    echo $p1 not found
  fi
fi

# put a white space
echo

i have the above piece of code that accepts a parameter input to display directory file listing. the script runs fine on the unix command line with an example output of:

Code:
$ sh dir_file_list.sh /u02/app/pcrd/dev/out
current directory /u02/app/pcrd/dev/out
total 24
drwxr-xr-x    3 oracle   oracle          256 Jun 29 14:10 ..
-rw-r--r--    1 oracle   oracle         5597 Jul 04 18:00 PCARD_EXPORT_7.csv
drwxr-xr-x    2 oracle   oracle          256 Jul 06 18:00 .
-rw-r--r--    1 oracle   oracle          311 Jul 06 18:00 PCARD_EXPORT_8.csv

i created the script to run from a scheduler called TIDAL. basically the scheduler is tool that runs on a windows platform and has agents on each servers that operates and runs any programs. when the script runs from a scheduler it gets a message on the first line as "Where are you?":
Code:
Where are you?
current directory /u02/app/pcrd/dev/out
total 24
drwxr-xr-x    3 oracle   oracle          256 Jun 29 14:10 ..
-rw-r--r--    1 oracle   oracle         5597 Jul 04 18:00 PCARD_EXPORT_7.csv
drwxr-xr-x    2 oracle   oracle          256 Jul 06 18:00 .
-rw-r--r--    1 oracle   oracle          311 Jul 06 18:00 PCARD_EXPORT_8.csv

how do i suppress that "Where are you?" message? thanks.

Last edited by wtolentino; 07-07-2009 at 02:09 PM..
# 2  
Old 07-08-2009
"biff n" usage on shell script

my script has a line of code for "biff n" that is to suppress the mail notification or disable them. i observed that when we run the script from a scheduler (TIDAL Enterprise Scheduler) it gives us an output "Where are you?" message. if i removed that piece of code it is no longer giving us that message. i am thinking that on the succession run of the same script that is the time that it gives the message. i want to put a conditional if-then statement to check if the "biff" is currently set to "n". how do i put that into my script.

i tried this code but it never got it work.
Code:
if [biff n eq 0]; then
 echo yes
fi

thanks,
warren
# 3  
Old 07-10-2009
Do you want, perhaps, to run the script interactively, and if so, biff works, but if run from a scheduler, keep biff off? Try this:

Code:
if tty &>/dev/null ; then
   biff y
fi

Though this doesn't answer your question, I think it solves your problem.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. UNIX for Dummies Questions & Answers

Suppress "No such file or directory" in ls

Hi In csh I like to do something like this:if ( `ls /tmp/foo*.xml | wc -l` ) echo "Files found" If no files exist I get an error "No such file or directory". I know how to get rid of this message by using( ls /tmp/foo*.xml > /dev/tty ) >& /dev/null Now I like to do something like this:if... (2 Replies)
Discussion started by: Wernfried
2 Replies

5. UNIX for Dummies Questions & Answers

Unix "look" Command "File too large" Error Message

I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this: $ look "string" "/home/patrick/filename.txt" However, this gives me the following message: "look: /home/patrick/filename.txt: File too large" So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

8. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

9. Shell Programming and Scripting

suppress bash's "Done" message

Hi, I'm running a background job in my bash script. But when the job quit, bash echos a message like "+ Done xterm". This is annoying. How can I suppress it? (5 Replies)
Discussion started by: momiji
5 Replies
Login or Register to Ask a Question