Skip to content
Advertisement

Tag: bash

Image upload using curl

I want to upload image to remote site using curl cli version, i browse several pages here, but not able to solve my problem. I log http header in firefox while uploading image: Answer The basic curlsyntax would be curl -F “image=@/yourPath/yourImageFile.jpg” ‘https://www.site.xxx/upload_profile_picture/’ Specify other POST data fields with one or several additional -F options if necessary, as

U-Boot version extraction for comparision

I am trying to extract U-Boot version from its binary for comparison, consider that exact string what I want to search is as follow, so I wrote command with regex as follows, However I don’t see any output for that above command, I could make below command work which extracts version only by comparing versions and not looking for date

tail the last modified file and monitor for new files in bash

I can tail -f the last modified file using ls –sort=time | head -1 | xargs tail -f but I’m looking for something that would continuously run the first part as well, i.e. if a new files is created while the tail command is running it switches to tailing the new file. I thought about using watch command but that

Read and run different command based on each line of file in Bash Linux?

I am completely new to bash scripting. I am trying to write a script in order to read line by line recent_log.txt which has the following content: and then run the command below for each line depend on the suffix. Output should be in another file. each output should have 2 lines space between them. This is my solution so

Get words from positions in string – Bash/Linux

I have the following string that I want to extract name and id from and store them in a variable. This is just an example, the list can be longer but they are separated the same way. The id’s in the string is freepbx and cidlookup, the names are NEWUPDATES and noauth. I’d like them to come out like: I’m

Advertisement