Skip to content
IT Nursery
  • Home
  • Programming
    • PHP
    • C
    • C++
  • DataBase
    • MySQL
  • CMS
    • WordPress

shell

How to preserve line breaks when storing command output to a variable?

by IT Nursery

I’m using bash shell on Linux. I have this simple script … #!/bin/bash TEMP=`sed -n “https://stackoverflow.com/””Starting deployment of”‘/,/'”Failed to start context”‘/p’ “/usr/java/jboss/standalone/log/server.log” | … Read more

Tags bash, line-breaks, linux, shell

Run a string as a command within a Bash script

by IT Nursery

I have a Bash script that builds a string to run as a command Script: #! /bin/bash matchdir=”/home/joao/robocup/runner_workdir/matches/testmatch/” teamAComm=”`pwd`/a.sh” teamBComm=”`pwd`/b.sh” include=”`pwd`/server_official.conf” serverbin=’/usr/local/bin/rcssserver’ cd … Read more

Tags bash, command-line-arguments, shell

How do I delete/remove a shell function?

by IT Nursery

I have done this: $ z() { echo ‘hello world’; } How do I get rid of it? 2 Answers 2

Tags bash, shell, zsh

Print a file’s last modified date in Bash

by IT Nursery

I can’t seem to find how to print out the date of a file. I’m so far able to print out all the … Read more

Tags bash, date, file, shell, unix

The ‘eval’ command in Bash and its typical uses

by IT Nursery

After reading the Bash man pages and with respect to this post, I am still having trouble understanding what exactly the eval command … Read more

Tags bash, eval, linux, scripting, shell

List files with certain extensions with ls and grep

by IT Nursery

I just want to get the files from the current dir and only output .mp4 .mp3 .exe files nothing else. So I thought … Read more

Tags bash, grep, macos, shell

How to set child process’ environment variable in Makefile

by IT Nursery

I would like to change this Makefile: SHELL := /bin/bash PATH := node_modules/.bin:$(PATH) boot: @supervisor \ –harmony \ –watch etc,lib \ –extensions js,json … Read more

Tags environment-variables, makefile, shell, target

How to merge 2 JSON objects from 2 files using jq?

by IT Nursery

I’m using the jq tools (jq-json-processor) in shell script to parse json. I’ve got 2 json files and want to merge them into … Read more

Tags command-line, jq, json, shell

How to use sed to remove the last n lines of a file

by IT Nursery

I want to remove some n lines from the end of a file. Can this be done using sed? For example, to remove … Read more

Tags bash, linux, sed, shell

How to get the part of a file after the first line that matches a regular expression

by IT Nursery

I have a file with about 1000 lines. I want the part of my file after the line which matches my grep statement. … Read more

Tags bash, grep, scripting, shell
Post navigation
Older posts
Page1 Page2 … Page33 Next →

Important Tag

.net admin ajax android arrays bash c categories comments CSS custom-field custom-post-types custom-taxonomy customization database filters functions git hooks HTML images ios java javascript jQuery menus multisite MySQL node.js permalinks php plugin-development plugins posts python Shortcode sql string theme-development themes uploads users woocommerce-offtopic wp-admin wp-query

Recent Posts

  • INSTALL_FAILED_DUPLICATE_PERMISSION… C2D_MESSAGE
  • How to sort by meta value?
  • WPF text Wrap vs WrapWithOverflow
  • How to retrieve the list of all posts ever published via the feed?
  • how to use javascript Object.defineProperty

android c categories CSS custom-post-types custom-taxonomy customization database functions git HTML images java javascript jQuery multisite MySQL php plugin-development plugins posts python string theme-development wp-query

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Content from: Stack Exchange

Important Link

  • About
  • Privacy Policy

IT Nursery

The Goal of ITNursery Engaging the world to foster innovation through aggregate information. Our Question Answer post, blog information, products and tools help developers and technologists in life and at work.

copyright © 2023 All Right Reserved | IT NurSery