I have a problem about execute command remotely via SSH. I am trying below. It gives an error like: Answer The problem is that you’re using double quotes to delimit the argument to ssh and also the argument to psql inside the command. This is causing your strings to be parsed incorrectly. You’re also missing the ending double quote for
Tag: shell
how to create a linux shell alias to give to g++ compiler the path of the file to compile?
What I want to do it’s to create an alias for the sentence below: Because I have to compile single files frequently. To do it, I’m trying creating a txt file with the output file name and the path of the file to compile. So I have a txt, called tocompile.txt, file that contains: then, I assign to a var
Script terminates when storing grep -c output when value is 0
I am trying to check if a file has CR line feed and store the result 0 or 1 into a variable. Here is my command that runs inside a script. The script runs until the previous line and doesn’t run this line but terminates abruptly. Inside an echo statement it works perfectly. This prints isCR=0 or isCR=1 depending on
How to access specific path in linux using shellscript
Let us consider an example, scriptPath=/home/sharath/Downloads/Atollic_TrueSTUDIO_for_STM32_9.2.0_installer In the above line of code, If user is “sharath” then he can access a file/folder same way if the user is different how can access that folder/file dynamically. below is my shellscript(.sh file): In last line of the script, ${scriptPath} is diffrent for diffrent user, how can handle in shell script. Update 1:
How do I extract everything in a file after the first null character from shell
I have a file that looks like this: some ascii stuffsome more ascii stuffand a little more ascii stuff. I want to extract everything after the first . So my output after this process would be some more ascii stuffand a little more ascii stuff How would I go about doing this? This is done within initramfs so my access
In output, echo command printed new line when after printed variable
This is my small bash script code and i want to print the number of files created in the directory : My expected output is : but i got the below output: can you help what went wrong in my above code? Also please suggest if this is the correct way to print the number of files in the directory
I need a linux script to report all error lines from a log file, and export the results of error lines into a .csv file? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago. Improve this question I have log file for checking transactions, and I have error lines, so I need those error lines to be
bash script unable to ask confirmation
I am initiating myself to shell scripting and I need to ask the user about confirmation. I have this script, which I don’t know why the following command is not working: read -p “Are you sure about this action?” yn I use it twice, at the beggining of the script and in the middle. The first read works, but the
need help on shell script for expected output
I have an input file called input.txt like this: I extract the text up to just before the fist capital letter in the first field and store those snippets in output.txt: I used the sed command to separate out the values and it’s working fine. From the output file (output.txt), I need to grep from the first field, and output
Decode base64 strings into hex strings in a file and overwrite
I have a list of base64 strings in a file (file.txt) that I need to convert into hex. E.g., Command: This command works individually (albeit the spaces in between), but I need to convert through each string in the file, which has more than 500 lines. Basically, I want the above base64 string format to be decoded to the below