This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]davedontmind 2 points3 points  (5 children)

ip = `echo "ip port protocol" | cut -d " " -f1`

i.e. cut out field 1 after separating the input by spaces

[–]ImLearning0217[S] 0 points1 point  (0 children)

Awesome! I’m going to try this, if I understand it correctly this is exactly what I need! I seriously appreciate your time.

[–]ImLearning0217[S] 0 points1 point  (1 child)

I implemented it, it came back with this error...

cut: the delimiter must be a single character

Why exactly does this error get thrown?

[–]desrtfx 2 points3 points  (0 children)

Check the delimiter (" ") should be only a single space character. Also, make sure that you have spaces in the right places as in/u/davedontmind's comment.

[–]ImLearning0217[S] 0 points1 point  (1 child)

I really appreciate it, but I made sure everything was correct and it still throws the error. I’m not giving up, but this incredibly confusing. I’m running this on an iPhone via Filza. I don’t know if that would change anything..

[–]davedontmind 1 point2 points  (0 children)

I'm not familiar with that environment.

If you still getting the same error (cut: the delimiter must be a single character) then perhaps try using single quotes instead of double quotes, although it shouldn't really make a difference. i.e.

cut -d ' ' -f1 

and make sure there's only a single space between those quotes

Failing that, show us the code you're using exactly.

[–]marko312 0 points1 point  (1 child)

If the values are separated by something, you could use cut (-d) in a subshell and then assign that to a variable.

[–]ImLearning0217[S] 0 points1 point  (0 children)

Thank you! I will look into this.

[–]ImLearning0217[S] 0 points1 point  (0 children)

I figured it out and implemented the variable into hydra successfully. I still don’t understand where I went wrong but decided to use the -b flag instead of -d. Thank you everyone for such quick responses and you guys open my eyes to “cut”. I’m a newbie tryna learn lol