Stty: : No such device or address


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Stty: : No such device or address
# 1  
Old 08-07-2013
Stty: : No such device or address

hi,

i am trying to execute a script through Cron, then everytime it is redirecting a message
stty: : No such device or address
Unmatched `


here is the cron entry:
Code:
35,40,45,50,55 04,05 07 08 * /uv1402/u207/home/bravodba/bestdbscript/shscriptfiles/bravo_main_refresh.sh

while the script is running pretty fine ehile running through command prompt. Please suggest.
# 2  
Old 08-07-2013
Try to call the shell instead:
Code:
35,40,45,50,55 04,05 07 08 * /path/to/sh /uv1402/u207/home/bravodba/bestdbscript/shscriptfiles/bravo_main_refresh.sh

If sh is bash, then use bash.

Oh yes. The problem is that you're no longer calling the script on a terminal making stty show that message so my suggestion above won't really help sorry. Perhaps modifying the script to work with non-terminal input and output might help.

Perhaps using a tty emulator or virtualizer like screen, expect, or ttyrec and the likes would help perhaps.
# 3  
Old 08-07-2013
i couldn't get what you are trying to say, please explain briefly
# 4  
Old 08-07-2013
When running with cron, remember that you don't actually have a terminal. If your script issues stty commands, then you will get this error. You either have to handle the error, live with it or exclude it in the cron entry.

So you could in the script find and edit lines like this:-
Code:
stty erase ^H 2>/dev/null

Check any .profile, /etc/profile and called / sourced scripts too, perhaps to include .kshrc .bash_rc or similar.

In your cron entry:-
Code:
35,40,45,50,55 04,05 07 08 * /uv1402/u207/home/bravodba/bestdbscript/shscriptfiles/bravo_main_refresh.sh 2>&1|grep -v "^stty:"


I hope that this helps


Robin
Liverpool/Blackburn
UK
# 5  
Old 08-07-2013
i agree, this will help me to hide stty : : no such device or address error.

but it seems to me that actual error is coming while establishing the connection and when it finds ` symbol. here is the initial code of my script.

Code:
#!/bin/csh

stty erase ^H 2>/dev/null

`sqlplus -s $ORACLE_USER/$ORACLE_PASS@$ORACLE_SID   << EOF > sql_output.txt
                select count(*) from bravo_statistics
                where trunc(time_stamp)=trunc(sysdate)
                and description in ('BEGIN NIT','END MR');
EOF`


and i have modified cron as per above suggestion.
Code:
20,25,30,35,40,44,50,55 04,05,6 07 08 * /uv1402/u207/home/bravodba/bestdbscript/shscriptfiles/bravo_main_refresh.sh  2>&1|gr
ep -v "^stty:"

it is a .sh extension script, so please let me know what needs to be corrected here?
# 6  
Old 08-07-2013
Why are you using backquotes to execute SQLPlus? That's quite pointless. SQLPlus is already executable.

You could also just check for the terminal type in your profile / script:

Code:
$ echo $TERM
xterm-256color

$ crontab -l
* * * * * echo $TERM > /tmp/TERM.txt

...

$ cat /tmp/TERM.txt
dumb

# 7  
Old 08-07-2013
everything was working properly when i was trying to run the script manually, but now i have removed ` sign from sqlplus
Code:
sqlplus -s $ORACLE_USER/$ORACLE_PASS@$ORACLE_SID   << EOF > sql_output.txt
                select count(*) from bravo_statistics
                where trunc(time_stamp)=trunc(sysdate)
                and description in ('BEGIN NIT','END MR');
EOF
big_cnt=`sed -n '4p' sql_output.txt`
if [ $big_cnt -eq 0 ] ; then

and it is giving below error now:

Quote:
stty: : No such device or address
stty: : No such device or address
big_cnt=0: Command not found
big_cnt: Undefined variable
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. HP-UX

Failed to open tape device /dev/rmt/0mn:Device busy (errno = 16)

Hi, Unable to make tape backup, please help. /opt/ignite/bin/make_tape_recovery -a /dev/rmt/?mn -I -v -m tar -x inc_entire=vg00 * Creating local directories for configuration files and archive. ======= 04/25/16 16:28:08 IST Started /opt/ignite/bin/make_tape_recovery. (Mon... (4 Replies)
Discussion started by: anuragr
4 Replies

2. Debian

Problem configuring IP address on remote device

I need to add a printer with Ethernet to my local network. The default IP address in the printer is 0.0.0.0 and I need to change it to a 192.168.0.x address. I have previously temporarily changed the IP address of a computer (with ifconfig) to an address similar to the new device and changed the... (8 Replies)
Discussion started by: snorkack59
8 Replies

3. Red Hat

Unable To Activate Ethernet Network Device in RHEL 5.5 - e100 device eth0 does not seem to be presen

Hi All, Could anyone please help to resolve the below problem. I installed RHEL5.5 in my desktop.But when i try to activate the ethernet connection then it gives me the error. I spent 2 days for the above and go through with several suggestion found by googling. But no luck. ... (0 Replies)
Discussion started by: Tanmoy
0 Replies

4. Solaris

sar : insufficient address space to load xxxx device records

Hello, i am using Solaris 10, The sar running in my system might be corrupted, but not sure why as there has been no updates to it ( to the best of my knowledge) and it was working fine until few days back. If i try to get sar reports using sar -o <filename> 60 180 there is no error but the... (2 Replies)
Discussion started by: nimi20
2 Replies

5. UNIX for Dummies Questions & Answers

Device Probe freezes after detecting Ethernet address while installing FreeeBSD 7.0

I'm trying to install FreeBSD 7.0 from CDs I made a few months ago on a brand new system with parts I just got in from NewEgg. I select the default option from the Boot Loader and it goes into the device probe. Several devices are recognized, but then it freezes at: mskc0: <Marvell Yukon... (2 Replies)
Discussion started by: ideogon
2 Replies

6. UNIX for Dummies Questions & Answers

"/dev/rmt/0: No such device or address" when using mt command

/dev/rmt/0: No such device or address I get this when I do a "mt -f /dev/rmt/0 rewind" This is on a Solaris 7 system. I tried devfsadm -c tape and drvconfig ; tape and both didn't work. Help please....... :confused: (4 Replies)
Discussion started by: shorty
4 Replies

7. Shell Programming and Scripting

stty: : No such device or address

I encoutered the error "stty: : No such device or address" in the korn shell script log. I added STTY EARSE ^H in profile. why iam i getting that error in Korn shell Thanks nandinisagar (6 Replies)
Discussion started by: nandinisagar
6 Replies
Login or Register to Ask a Question