functions with touch [closed]
Clash Royale CLAN TAG#URR8PPP
1
Why doesn't the following work?
function xyz() touch $1;
xyz temp1.txt
I get an error
touch: missing file operand
Try `touch --help' for more information.
bash shell-script
closed as off-topic by DopeGhoti, Jeff Schaller, mosvy, steeldriver, GAD3R Jan 8 at 20:25
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – DopeGhoti, mosvy, steeldriver, GAD3R
add a comment |
1
Why doesn't the following work?
function xyz() touch $1;
xyz temp1.txt
I get an error
touch: missing file operand
Try `touch --help' for more information.
bash shell-script
closed as off-topic by DopeGhoti, Jeff Schaller, mosvy, steeldriver, GAD3R Jan 8 at 20:25
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – DopeGhoti, mosvy, steeldriver, GAD3R
Welcome to Unix&Linux at StackExchange! I just tried your two exact commands on bash and it worked for me... Can you double check your setup? Trytype xyz
to see what bash thinks the definition of your function is...
– filbranden
Jan 8 at 18:46
1
Did you perhaps run something more interesting, likexyz "file name with spaces"
?
– Jeff Schaller
Jan 8 at 19:08
Sorry! It worked fine. Thank you for quick (and kind) responses.
– user330468
Jan 8 at 20:00
add a comment |
1
1
1
Why doesn't the following work?
function xyz() touch $1;
xyz temp1.txt
I get an error
touch: missing file operand
Try `touch --help' for more information.
bash shell-script
Why doesn't the following work?
function xyz() touch $1;
xyz temp1.txt
I get an error
touch: missing file operand
Try `touch --help' for more information.
bash shell-script
bash shell-script
asked Jan 8 at 18:44
user330468user330468
61
61
closed as off-topic by DopeGhoti, Jeff Schaller, mosvy, steeldriver, GAD3R Jan 8 at 20:25
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – DopeGhoti, mosvy, steeldriver, GAD3R
closed as off-topic by DopeGhoti, Jeff Schaller, mosvy, steeldriver, GAD3R Jan 8 at 20:25
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – DopeGhoti, mosvy, steeldriver, GAD3R
Welcome to Unix&Linux at StackExchange! I just tried your two exact commands on bash and it worked for me... Can you double check your setup? Trytype xyz
to see what bash thinks the definition of your function is...
– filbranden
Jan 8 at 18:46
1
Did you perhaps run something more interesting, likexyz "file name with spaces"
?
– Jeff Schaller
Jan 8 at 19:08
Sorry! It worked fine. Thank you for quick (and kind) responses.
– user330468
Jan 8 at 20:00
add a comment |
Welcome to Unix&Linux at StackExchange! I just tried your two exact commands on bash and it worked for me... Can you double check your setup? Trytype xyz
to see what bash thinks the definition of your function is...
– filbranden
Jan 8 at 18:46
1
Did you perhaps run something more interesting, likexyz "file name with spaces"
?
– Jeff Schaller
Jan 8 at 19:08
Sorry! It worked fine. Thank you for quick (and kind) responses.
– user330468
Jan 8 at 20:00
Welcome to Unix&Linux at StackExchange! I just tried your two exact commands on bash and it worked for me... Can you double check your setup? Try
type xyz
to see what bash thinks the definition of your function is...– filbranden
Jan 8 at 18:46
Welcome to Unix&Linux at StackExchange! I just tried your two exact commands on bash and it worked for me... Can you double check your setup? Try
type xyz
to see what bash thinks the definition of your function is...– filbranden
Jan 8 at 18:46
1
1
Did you perhaps run something more interesting, like
xyz "file name with spaces"
?– Jeff Schaller
Jan 8 at 19:08
Did you perhaps run something more interesting, like
xyz "file name with spaces"
?– Jeff Schaller
Jan 8 at 19:08
Sorry! It worked fine. Thank you for quick (and kind) responses.
– user330468
Jan 8 at 20:00
Sorry! It worked fine. Thank you for quick (and kind) responses.
– user330468
Jan 8 at 20:00
add a comment |
1 Answer
1
active
oldest
votes
0
Unable to replicate:
$ function xyz() touch "$1";
$ xyz temp1.txt
$ ls temp1.txt
temp1.txt
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
0
Unable to replicate:
$ function xyz() touch "$1";
$ xyz temp1.txt
$ ls temp1.txt
temp1.txt
add a comment |
0
Unable to replicate:
$ function xyz() touch "$1";
$ xyz temp1.txt
$ ls temp1.txt
temp1.txt
add a comment |
0
0
0
Unable to replicate:
$ function xyz() touch "$1";
$ xyz temp1.txt
$ ls temp1.txt
temp1.txt
Unable to replicate:
$ function xyz() touch "$1";
$ xyz temp1.txt
$ ls temp1.txt
temp1.txt
answered Jan 8 at 19:21
DopeGhotiDopeGhoti
44.3k55684
44.3k55684
add a comment |
add a comment |
Welcome to Unix&Linux at StackExchange! I just tried your two exact commands on bash and it worked for me... Can you double check your setup? Try
type xyz
to see what bash thinks the definition of your function is...– filbranden
Jan 8 at 18:46
1
Did you perhaps run something more interesting, like
xyz "file name with spaces"
?– Jeff Schaller
Jan 8 at 19:08
Sorry! It worked fine. Thank you for quick (and kind) responses.
– user330468
Jan 8 at 20:00