Sponsored Content
Top Forums Shell Programming and Scripting Suppress "Where are you?" Message Post 302331820 by wtolentino on Tuesday 7th of July 2009 09:12:21 AM
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..
 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
CHING(6)							   Games Manual 							  CHING(6)

NAME
ching, fortune - the book of changes and other cookies SYNOPSIS
/usr/games/ching [ hexagram ] /usr/games/fortune DESCRIPTION
The I Ching or Book of Changes is an ancient Chinese oracle that has been in use for centuries as a source of wisdom and advice. The text of the oracle (as it is sometimes known) consists of sixty-four hexagrams, each symbolized by a particular arrangement of six straight (---) and broken (- -) lines. These lines have values ranging from six through nine, with the even values indicating the broken lines. Each hexagram consists of two major sections. The Judgement relates specifically to the matter at hand (E.g., "It furthers one to have somewhere to go.") while the Image describes the general attributes of the hexagram and how they apply to one's own life ("Thus the supe- rior man makes himself strong and untiring."). When any of the lines have the values six or nine, they are moving lines; for each there is an appended judgement which becomes signifi- cant. Furthermore, the moving lines are inherently unstable and change into their opposites; a second hexagram (and thus an additional judgement) is formed. Normally, one consults the oracle by fixing the desired question firmly in mind and then casting a set of changes (lines) using yarrow-stalks or tossed coins. The resulting hexagram will be the answer to the question. Using an algorithm suggested by S. C. Johnson, the Unix oracle simply reads a question from the standard input (up to an EOF) and hashes the individual characters in combination with the time of day, process id and any other magic numbers which happen to be lying around the system. The resulting value is used as the seed of a random number generator which drives a simulated coin-toss divination. The answer is then piped through nroff for formatting and will appear on the standard output. For those who wish to remain steadfast in the old traditions, the oracle will also accept the results of a personal divination using, for example, coins. To do this, cast the change and then type the resulting line values as an argument. The impatient modern may prefer to settle for Chinese cookies; try fortune. SEE ALSO
It furthers one to see the great man. DIAGNOSTICS
The great prince issues commands, Founds states, vests families with fiefs. Inferior people should not be employed. BUGS
Waiting in the mud Brings about the arrival of the enemy. If one is not extremely careful, Somebody may come up from behind and strike him. Misfortune. CHING(6)
All times are GMT -4. The time now is 12:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy