08-27-2009
unix command - what happens under the hood
Hello everyone,
When I run the command: rm adkjad (assuming the file adkjad doesn't exist), I get the following message:
adkjad: No such file or directory
I want to run this command, but I want a succesful return code whether the file is there or not.
I tried: rm adkjad 2> /dev/null , redirecting stderr to never never land, but I still get some type of negative return code.
Is there some other output(I am unware of) that I can send to /dev/null also?
Thanks in advance.
Robert
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi all. thanks for looking
i am doing some homework.
one question is that when type
wc
and then how to tell the program that we have finished entering data?
also
why do some operating systems report 22 as the number of bytes in the file above, while others only 20?
thanks so much,... (1 Reply)
Discussion started by: dashi2k
1 Replies
2. Shell Programming and Scripting
Hello,
I have problem in writing the shell script involving MPE command STREAM related to HP-UX and Unix command. Script is
sh "nlshCMD 'STREAM <job name1>' | 'SHOWJOB' | grep $HPJOBNUM"
sh "nlshCMD 'STREAM <job name2>' | 'SHOWJOB' | grep $HPJOBNUM"
sh "nlshCMD 'STREAM <job name3>' |... (0 Replies)
Discussion started by: bosskr
0 Replies
3. HP-UX
Hello,
I have problem in writing the shell script involving MPE command STREAM related to HP-UX and Unix command. Script is
sh "nlshCMD 'STREAM <job name1>' | 'SHOWJOB' | grep $HPJOBNUM"
sh "nlshCMD 'STREAM <job name2>' | 'SHOWJOB' | grep $HPJOBNUM"
sh "nlshCMD 'STREAM <job name3>' |... (1 Reply)
Discussion started by: bosskr
1 Replies
4. Shell Programming and Scripting
Hi ,
I have a piece of code ...wherein I need to assign the following ...
1) A command line argument to a variable
e.g origCount=ARGV
2) A unix command to a variable
e.g result=`wc -l testFile.txt`
in my awk shell script
When I do this :
print "origCount" origCount --> I get the... (0 Replies)
Discussion started by: sweta_doshi
0 Replies
5. UNIX for Advanced & Expert Users
Hi,
Well my title isn't very clear I think. So to understand my goal:
I have a script "test1"
#!/bin/bash
xvkbd -text blabla
with xbindkeys, I bind F5 key in order it runs my test1 script
So when I press F5, test1 runs.
I'm under Emacs/Vi and I press F5 in order to have "blabla" be... (0 Replies)
Discussion started by: xib.be
0 Replies
6. UNIX for Dummies Questions & Answers
I am going through the Unix Made Easy second edition book by John Muster. So far it's been very informative and I can tell it may be a bit out of date.
In one of the exercises it talks about the "sort" command and using it to sort column's of data etc. The "sort" command has changed a bit and... (1 Reply)
Discussion started by: budfoxcat
1 Replies
7. UNIX Desktop Questions & Answers
Hi all,
I wish to know whether Unix can access window's file in Unix's terminal?
Apart from that, how to copy files or share files between Window and Unix? I get to know of secure copy, however, my company's Unix does not support the feature of secure copy? Any other method for me to share/... (5 Replies)
Discussion started by: jessy83
5 Replies
8. Shell Programming and Scripting
I'm trying to write a bash script called YN that looks like the following
YN "Specify a question" "doThis" "doThat"
where "doThis" will be executed if the answer is "y", otherwise "doThat".
For example
YN "Do you want to list the file dog?" "ls -al dog" ""
Here's my attempt... (3 Replies)
Discussion started by: LeoKSimon
3 Replies
9. Shell Programming and Scripting
Hi Folks,
I have a file name abc.xml in my windows machine at the location c:\ytr\abc.xml
which I want to place at the unix box machine inside cde directory.. at the following location that is /opt/app/cde/
now the credentials of unix box are
abc345 -->(dummyid)
ftyiu88--->(dummy passwd)
... (4 Replies)
Discussion started by: punpun66
4 Replies
CU(1C) CU(1C)
NAME
cu - call UNIX
SYNOPSIS
cu telno [ -t ] [ -s speed ] [ -a acu ] [ -l line ]
DESCRIPTION
Cu calls up another UNIX system, a terminal, or possibly a non-UNIX system. It manages an interactive conversation with possible transfers
of text files. Telno is the telephone number, with minus signs at appropriate places for delays. The -t flag is used to dial out to a
terminal. Speed gives the transmission speed (110, 134, 150, 300, 1200); 300 is the default value.
The -a and -l values may be used to specify pathnames for the ACU and communications line devices. They can be used to override the fol-
lowing built-in choices:
-a /dev/cua0 -l /dev/cul0
After making the connection, cu runs as two processes: the send process reads the standard input and passes most of it to the remote sys-
tem; the receive process reads from the remote system and passes most data to the standard output. Lines beginning with `~' have special
meanings.
The send process interprets the following:
~. terminate the conversation.
~EOT terminate the conversation
~<file send the contents of file to the remote system, as though typed at the terminal.
~! invoke an interactive shell on the local system.
~!cmd ... run the command on the local system (via sh -c).
~$cmd ... run the command locally and send its output to the remote system.
~%take from [to] copy file `from' (on the remote system) to file `to' on the local system. If `to' is omitted, the `from' name is used
both places.
~%put from [to] copy file `from' (on local system) to file `to' on remote system. If `to' is omitted, the `from' name is used both
places.
~~... send the line `~...'.
The receive process handles output diversions of the following form:
~>[>][:]file
zero or more lines to be written to file
~>
In any case, output is diverted (or appended, if `>>' used) to the file. If `:' is used, the diversion is silent, i.e., it is written only
to the file. If `:' is omitted, output is written both to the file and to the standard output. The trailing `~>' terminates the diver-
sion.
The use of ~%put requires stty and cat on the remote side. It also requires that the current erase and kill characters on the remote sys-
tem be identical to the current ones on the local system. Backslashes are inserted at appropriate places.
The use of ~%take requires the existence of echo and tee on the remote system. Also, stty tabs mode is required on the remote system if
tabs are to be copied without expansion.
FILES
/dev/cua0
/dev/cul0
/dev/null
SEE ALSO
dn(4), tty(4)
DIAGNOSTICS
Exit code is zero for normal exit, nonzero (various values) otherwise.
BUGS
The syntax is unique.
CU(1C)