08-16-2007
Use "strace" to debug
Abhishek,
Some programs have few compatibility issues with "Terminal" and related libraries like "curses" etc. The only way to troubleshoot is run your complete command with "strace" and redirect stdout and stderr to some log-file. You may able to locate the root of problem.
Alternatively you can download the source and compile it on the target machine where you want to run intended script. That may eliminate problem
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'm receiving an exit code 64 in our batch scheduler (BMC product control-m) executing a PERL script on UX-HP. Can you tell me where I can find a list of exit codes and their meaning. I'm assuming the exit code is from the Unix operating system not PERL. (3 Replies)
Discussion started by: jkuchar747
3 Replies
2. Shell Programming and Scripting
HI All,
I have created a unix script which takes 2 parameters and using sftp tranfers files to remote location
following is the script
#!/bin/ksh
#
#
# Parameter 1 is the complete path of the destination server
# Parameter 2 is the complete path of the file which is to be FTP... (1 Reply)
Discussion started by: vikramsnest
1 Replies
3. Shell Programming and Scripting
Hi All,
I need the exit status of a command which is executed through sftp connection.
Example:
sftp user@host <<EOF
mkdir /home/karteek/testing
put /home/xyz.txt /home/karteek/testing
EOF
------
In the above example, I need the exit status of the put command.
Please help me.
... (2 Replies)
Discussion started by: Karteek
2 Replies
4. Solaris
HI guys
When i try SFTP to a machine using a user account whose entry in
/etc/passwd as follows
user:x:8005:508::/export/home/user:/bin/false
and i am not placed my keys over there i am using the password option in the sftp
Since the keys are not there it ask for the password
... (5 Replies)
Discussion started by: GIC1986
5 Replies
5. Shell Programming and Scripting
Solaris 10 9/10
BASH
using the following code snippet:
sftp $TOHOST <<RESULT
cd /inbound/
lcd /transfer
put $i
bye
I want to log no server connections and the kill the script after the log entry was made. How would I do... (2 Replies)
Discussion started by: os2mac
2 Replies
6. Shell Programming and Scripting
Hi All,
I am transfering a file through sftp. But the script is hanging at exit occasionally.
I am suspecting that sftp is hanging due to buffer size issue.
If that is the case can any body suggest a solution.
Please find the code.
echo "cd /${CUST_ID}/inbound/${SAFET_ID}" >... (0 Replies)
Discussion started by: Girish19
0 Replies
7. Shell Programming and Scripting
Hi All,
I would like to know whether is there any difference in closing the sftp connection with exit, bye and quit.
And would like to know the reliable command. (3 Replies)
Discussion started by: Girish19
3 Replies
8. Shell Programming and Scripting
Hi All
I was trying to execute below sftp command.
echo "cd /${CUST_ID}/inbound/${SAFET_ID}" > $BATCHFILE
echo "put ${SOURCE_FILE} ${FILE_NAME}" >> $BATCHFILE
echo "exit" >> $BATCHFILE
cmd="sftp -o port=2022 -b $BATCHFILE user@$SERVER"
$cmd >> $LOGFILE 2>&1
if 2>>$LOGFILE
then... (3 Replies)
Discussion started by: Girish19
3 Replies
9. UNIX for Advanced & Expert Users
Hi
I am checking status of sftp in Health check script, sftp command is used to connect the server with secure RSA key, which is successfully get connected most of the time but in some case if RSA key ask for password then I need to exit sftp command after few second and continue to run... (1 Reply)
Discussion started by: ketanraut
1 Replies
10. UNIX for Dummies Questions & Answers
I'm trying to connect from Server A to Server B to transfer files from A to B. I'm using NUID A1 in Server A and NUID A2 in Server B. I have done the following the steps to setup password-less login.
1. Add the public key of A1 in A to the Authorized keys of A2 in B.
2. Add the public key of... (4 Replies)
Discussion started by: sanchid312
4 Replies
LEARN ABOUT X11R4
strace-log-merge
STRACE-LOG-MERGE(1) General Commands Manual STRACE-LOG-MERGE(1)
NAME
strace-log-merge - merge strace -ff -tt output
SYNOPSIS
strace-log-merge STRACE_LOG
strace-log-merge --help
DESCRIPTION
strace-log-merge merges the output of strace -ff -tt[t] command, prepending PID to each line and sorting the result using time stamp as a
key.
OPTIONS
--help Show program usage and exit.
STRACE_LOG
Output file name prefix of files produced by a strace -ff -tt[t] command.
EXIT STATUS
0 Success
Non-zero
Error occurred: either no argument specified (in that case a usage is printed), or something went wrong during the processing of
STRACE_LOG.* files.
USAGE EXAMPLE
$ strace -o sleepy -ff -tt -e trace=execve,nanosleep
sh -c 'sleep 0.1 & sleep 0.2 & sleep 0.3'
$ strace-log-merge sleepy | fold -w 72 -s
13475 21:13:52.040837 execve("/bin/sh", ["sh", "-c", "sleep 0.1 & sleep
0.2 & sleep 0."...], 0x7ffde54b2450 /* 33 vars */) = 0
13478 21:13:52.044050 execve("/bin/sleep", ["sleep", "0.3"],
0x5631be4f87a8 /* 33 vars */) = 0
13476 21:13:52.044269 execve("/bin/sleep", ["sleep", "0.1"],
0x5631be4f87a8 /* 33 vars */) = 0
13477 21:13:52.044389 execve("/bin/sleep", ["sleep", "0.2"],
0x5631be4f87a8 /* 33 vars */) = 0
13478 21:13:52.046207 nanosleep({tv_sec=0, tv_nsec=300000000}, NULL) = 0
13476 21:13:52.046303 nanosleep({tv_sec=0, tv_nsec=100000000}, NULL) = 0
13477 21:13:52.046318 nanosleep({tv_sec=0, tv_nsec=200000000}, NULL) = 0
13476 21:13:52.146852 +++ exited with 0 +++
13475 21:13:52.146942 --- SIGCHLD {si_signo=SIGCHLD,
si_code=CLD_EXITED, si_pid=13476, si_uid=1000, si_status=0, si_utime=0,
si_stime=0} ---
13477 21:13:52.247782 +++ exited with 0 +++
13475 21:13:52.247885 --- SIGCHLD {si_signo=SIGCHLD,
si_code=CLD_EXITED, si_pid=13477, si_uid=1000, si_status=0, si_utime=0,
si_stime=0} ---
13478 21:13:52.347680 +++ exited with 0 +++
13475 21:13:52.347786 --- SIGCHLD {si_signo=SIGCHLD,
si_code=CLD_EXITED, si_pid=13478, si_uid=1000, si_status=0, si_utime=0,
si_stime=0} ---
13475 21:13:52.348069 +++ exited with 0 +++
NOTES
strace-log-merge does not work well with strace logs generated by strace -tt invocation that pass midnight, as those lack the information
required for the proper sorting. Employing the -ttt option in the respective strace invocation should solve the problem.
BUGS
strace-log-merge does not perform any checks whether the files specified are in the correct format and implies that only files from a sin-
gle strace session match STRACE_LOG.* glob pattern.
HISTORY
The initial version of strace-log-merge was written by Denys Vlasenko in 2012.
REPORTING BUGS
Problems with strace-log-merge should be reported to the strace mailing list at <strace-devel@lists.sourceforge.net>.
SEE ALSO
strace(1)
strace UNKNOWN 2018-04-11 STRACE-LOG-MERGE(1)