help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Understanding Interpreter Spoofing


From: Lawrence Velázquez
Subject: Re: Understanding Interpreter Spoofing
Date: Sat, 04 Dec 2021 13:05:39 -0500
User-agent: Cyrus-JMAP/3.5.0-alpha0-4458-g51a91c06b2-fm-20211130.004-g51a91c06

On Sat, Dec 4, 2021, at 12:59 PM, iam_chunky_pie wrote:
> On Saturday, December 4th, 2021 at 7:31 AM, Kerin Millar 
> <kfm@plushkava.net> wrote:
>> On Sat, 04 Dec 2021 04:24:17 +0000
>> iam_chunky_pie via help-bash@gnu.org wrote:
>> > mv script ~/-i
>> >
>> > oldPATH=$PATH
>> >
>> > PATH=.
>> >
>> > -i
>>
>> In this instance, ./-i as conveyed as an argument to the interpreter 
>> (/bin/bash). Therefore, it won't be treated as an option.
>
> Thanks.  I thought as such but I can't get any of the commands to 
> accept -i as a file argument.  I've tried:
>
>     mv script '-i'
>     mv script "-i"
>
>     cd newdir
>     ln ../script -i --force
>
> None work.  The latter creates the hard link with the same name - 
> "script", not -i.  I can't figure out whats missing.

https://mywiki.wooledge.org/BashPitfalls#Filenames_with_leading_dashes

-- 
vq



reply via email to

[Prev in Thread] Current Thread [Next in Thread]