-
January 18th, 2008, 11:46 AM
#1
Junior Member
UNIX question
hi , I just wanna ask if it is possible to do this in UNIX: tar -xvfb 20 /dev/rct0
and if not , where is the mistake?
second what's the difference between * and $* in the begging of for when using sh?
and last what 's doing echo ${d-$1} combined with a command procedure ?
Last edited by [hack]supernova; January 18th, 2008 at 12:25 PM.
-
January 19th, 2008, 04:01 AM
#2
I will take a stab at the first question. You are ordering tar to extract a tar file, but what you are designating isn't one.
Only trust Pipe-smoking Penguins.
-
January 19th, 2008, 04:31 AM
#3
There are two rules for success in life:
Rule 1: Don't tell people everything you know.
-
January 22nd, 2008, 05:58 PM
#4
Junior Member
the 1st ok i did it , but what about the rest , I need some answers....
-
January 22nd, 2008, 06:06 PM
#5
Junior Member
the first statement is basically a tar command used incorrectly
you are probably trying to create a backup of a tape driver /dev/rct0.
the b parameter specifies the block size which is 20 as mentioned.
x is for extract.
v is for verbose.
tar -b 20 -cvvf bkp.tar /dev/rct0
The above command would be more sensible.
The $* is used to get in the arguments.
$1 $2 etc.
Read on Shell Scripting you will understand all the, or try reading on "regular expressions" Regex
-
January 23rd, 2008, 11:31 AM
#6
Junior Member
10x a lot. now if someone tell me what is doing this echo ${ d-$1 } everything will be perfect.
-
January 23rd, 2008, 11:42 AM
#7
From man sh
The syntax of the for command is:
for variable [in word ...]
do list
done
And..
$* Expands to the positional parameters, starting from one. When
the expansion occurs within a double-quoted string it expands to
a single field with the value of each parameter separated by the
first character of the IFS variable, or by a space if IFS is
unset.
And...
${parameter:-word}
Use Default Values. If parameter is unset or null, the expansion
of word is substituted; otherwise, the value of parameter is sub-
stituted.
rtfm?
Oliver's Law:
Experience is something you don't get until just after you need it.
-
January 23rd, 2008, 08:26 PM
#8
Junior Member
nice I'm so thankful for that.
Similar Threads
-
By gore in forum Other Tutorials Forum
Replies: 10
Last Post: March 28th, 2005, 08:38 AM
-
By Delta4ce in forum Newbie Security Questions
Replies: 7
Last Post: June 29th, 2003, 08:01 AM
-
By -DaRK-RaiDeR- in forum Newbie Security Questions
Replies: 9
Last Post: December 14th, 2002, 08:38 PM
-
By khakisrule in forum Tech Humor
Replies: 7
Last Post: July 29th, 2002, 03:53 PM
-
By smirc in forum AntiOnline's General Chit Chat
Replies: 3
Last Post: May 13th, 2002, 03:24 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|