I want to write one script with my alias but not able to add bang line in my script with echo command. I tried these ways: If I run these lines without alias then they work for me. With direct typing and using command I’ll get data in file cshCMD.csh as: #!/bin/csh ncl while when I use alias on command
Tag: shell
Shell: Pass function with arguments as function argument
I’m working on a shell program to automatise my Arch (mandatory btw) installation. To make it more interactive, I’ve built the following function: I’ve succeeded in passing an “echo Hello World!” as an argument and having it run. I’ve also been able to pass another function. For example: This calls yayinstall if yes and does nothing if no. My problem
Bash increase pid kernel to unlimited for huge loop
I’ve been try to make cURL on a huge loop and I run the cURL into background process with bash, there are about 904 domains that will be cURLed and the problem is that 904 domains can’t all be embedded because of the PID limit on the Linux kernel. I have tried adding pid_max to 4194303 (I read in this
To add certain characters at the end of line when the line ends with “:”
I have a text file which contains two types of entries as below: I want to add NA at the end of line where “/opt/Check/D1/test_1237” does not exist, which means the line ends with “:”. Please let me know how to do this. I tried doing like this But this adds NA to each line..I want to add NA to
I want to pipe the output of one script to different script that will process the output of the first script independently?
I have a very trivial bash script taking input from the user in the first step and then echo an output. I want to run the same script in different shells and let the first shell take input and echo its output and send it to the input of the other shell, and let the both of shells continue executing
How to split a single XML file into multiple based on tags
I have an XML file that have tags. I want to split files like this. Below is the code tried . But it is generating every single line into a new file I want to split this file based on ORDER tags alone as mentioned below Answer With any awk in any shell on every UNIX box: it’s obviously fragile
want to sort my log file on this timestamp 2019-06-29T12:39:23.428Z using sort command but confused as there are multiple delimeter
This is the format of timestamp on which 2019-06-29T12:39:23.428Z I want to sort. But the year is delimited by – and the time is delimited by : and both year and time are separated my T’. Tried this. Answer You can manually pick out each field to sort with -k from man: So something like this should sort your output:
How to run a command on file in directory recursively creating a new file in each directory being visited (Bash)?
I have a directory with a few sub-directories. I’d like to create a copy of each results.csv file in the same directory named results_cleaned.csv where certain lines will be removed. Each sub-directory is known to contain only a single file, results.csv. Running this on a single directory works: However, running the same command on a root, produces just a single
SSHpass : to access local variable on remote host
Unable to access local variable on remote host using sshpass. Can you please help me to pass local variable to pass on remote host using ssh pass for the below code snippet expected result: Answer Try this: You need to double quote your command line and right escaping.
How can I pass a python script as an argument?
I’m working on a program that I need to brute force with a 4 pin number in order to get a flag. This is for some Cybersecurity challenges. I was able to create a python script that will print every combination of 4 digits number. However, I don’t know how can I pass that as an argument to the program